[rofi] Switch to firefox

This commit is contained in:
2021-08-20 09:46:56 -04:00
parent 25476f17bf
commit 12a7240b9d
3 changed files with 10 additions and 6 deletions

View File

@ -13,10 +13,10 @@
URL="https://search.unbl.ink/?q=" URL="https://search.unbl.ink/?q="
main() { main() {
# Open rofi for prompt # Open rofi for prompt
query=$( rofi -dmenu -matching fuzzy -location 0 -p "Query > " ) query=$(rofi -dmenu -matching fuzzy -location 0 -p "Query > ")
if [[ -n "$query" ]]; then if [[ -n "$query" ]]; then
url=$URL$query url=$URL$query
/home/powellc/.asdf/shims/qutebrowser ":open -w $url" firefox --new-window $url
else else
exit exit
fi fi

View File

@ -55,8 +55,8 @@ urlencode() {
for ((i = 0; i < length; i++)); do for ((i = 0; i < length; i++)); do
local c="${1:i:1}" local c="${1:i:1}"
case $c in case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;; [a-zA-Z0-9.~_-]) printf "$c" ;;
*) printf '%%%02X' "'$c" ;; *) printf '%%%02X' "'$c" ;;
esac esac
done done
} }
@ -77,7 +77,7 @@ main() {
elif [[ $platform = 'ffsamlconf' ]]; then elif [[ $platform = 'ffsamlconf' ]]; then
firefox $URL firefox $URL
else else
qutebrowser --target window $URL firefox --new-window $URL
fi fi
else else
exit exit

View File

@ -22,4 +22,8 @@ if [ "$URL" = "" ]; then
exit 0 exit 0
fi fi
qutebrowser --target window "$URL" if [[ "$URL" = http* ]]; then
firefox --new-window "$URL"
else
firefox --new-window --search "$URL"
fi