From d496ea2d59a9e17e7f426bb596254be1f8256380 Mon Sep 17 00:00:00 2001 From: Zach-Button Date: Tue, 28 Apr 2015 11:02:45 -0600 Subject: [PATCH] Update dmenu_qutebrowser --- misc/userscripts/dmenu_qutebrowser | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/userscripts/dmenu_qutebrowser b/misc/userscripts/dmenu_qutebrowser index 3a73cdde5..36651e77a 100755 --- a/misc/userscripts/dmenu_qutebrowser +++ b/misc/userscripts/dmenu_qutebrowser @@ -28,21 +28,21 @@ # Use the hotkey to open in new tab/window, press 'o' to open URL in current tab/window # You can simulate "go" by pressing "o", as the current URL is always first in the list # -# I personally use "q" to launch this script. For me, my workflow is: +# I personally use "o" to launchq this script. For me, my workflow is: # Default keys Keys with this script -# O q +# O o # o o # go o # gO gC, then o +# (This is unnecessarily long. I use this rarely, feel free to make this script accept parameters.) # -url=$(echo "$QUTE_URL" | cat - ~/.local/share/qutebrowser/history ~/.config/qutebrowser/quickmarks | dmenu -l 15 -p qutebrowser) +[ -z "$QUTE_URL" ] && QUTE_URL='http://google.com' + +url=$(echo "$QUTE_URL" | cat - ~/.config/qutebrowser/quickmarks ~/.local/share/qutebrowser/history | dmenu -l 15 -p qutebrowser) url=$(echo $url | sed -E 's/[^ ]+ +//g' | egrep "https?:" || echo $url) [ -z "${url// }" ] && exit -if [ -n "$QUTE_FIFO" ]; then - echo "open $url" >> "$QUTE_FIFO" -else - qutebrowser "$url" -fi +echo "open $url" >> "$QUTE_FIFO" || qutebrowser "$url" +