summaryrefslogtreecommitdiff
path: root/qutebrowser/.local
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2016-04-19 15:24:25 +0100
committerUrbain Vaes <urbain@vaes.uk>2016-04-19 15:24:25 +0100
commite146e947c52ac4adbe426b3f893faff1e46ed5f8 (patch)
tree1605bf4eb78cc619988c92632f3cee2a56143fd5 /qutebrowser/.local
parent83bd503208d45fa837348441196dd07223b13e3e (diff)
Use GNU stow for dotfiles management
Diffstat (limited to 'qutebrowser/.local')
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/bookmarks-dmenu7
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/quickmarks-dmenu7
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw20
3 files changed, 34 insertions, 0 deletions
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/bookmarks-dmenu b/qutebrowser/.local/share/qutebrowser/userscripts/bookmarks-dmenu
new file mode 100755
index 0000000..0f89413
--- /dev/null
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/bookmarks-dmenu
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+url=$(cat ~/.config/qutebrowser/bookmarks/urls | dmenu -i -l 15 | awk '{print $1}')
+
+[ -z ${url} ] && exit
+
+echo "open $url" >> "$QUTE_FIFO"
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/quickmarks-dmenu b/qutebrowser/.local/share/qutebrowser/userscripts/quickmarks-dmenu
new file mode 100755
index 0000000..354b398
--- /dev/null
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/quickmarks-dmenu
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+url=$(cat ~/.config/qutebrowser/quickmarks | dmenu -i -l 15 | awk '{print $NF}')
+
+[ -z ${url} ] && exit
+
+echo "open $url" >> "$QUTE_FIFO"
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw b/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw
new file mode 100755
index 0000000..9bd6795
--- /dev/null
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/url-from-surfraw
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+DEFAULT_SEARCH=startpage
+
+if [[ $1 =~ ^-.$ ]]; then
+ option="$1"
+ shift 1
+fi
+
+is_elvi=$(surfraw -elvi | grep -c "^$1\s")
+nbr_words=$(echo $1 | wc -w)
+
+if [[ $is_elvi -eq 0 && $nbr_words -eq 1 && ($1 == *.* || $1 == *:*) ]]; then
+ url="$1"
+else
+ [[ $is_elvi -eq 0 ]] && sr="$DEFAULT_SEARCH $*" || sr=$*
+ url=$(surfraw -print $sr)
+fi
+
+echo "open $option $url" >> $QUTE_FIFO