summaryrefslogtreecommitdiff
path: root/qutebrowser/.local
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2017-05-31 17:26:15 +0100
committerUrbain Vaes <urbain@vaes.uk>2017-05-31 17:26:15 +0100
commitbd28d033d4e3ec923fdb81aee214de5ff01a92dd (patch)
tree007afb5260047739a6b00c8d02a880916ba98600 /qutebrowser/.local
parentd7260099e6b67e8161270d5b02ff30d00f8d61cd (diff)
[qutebrowser] Add script to change tabs
Diffstat (limited to 'qutebrowser/.local')
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/tab-switch6
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/zathura-open3
2 files changed, 7 insertions, 2 deletions
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/tab-switch b/qutebrowser/.local/share/qutebrowser/userscripts/tab-switch
new file mode 100755
index 0000000..b82ed36
--- /dev/null
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/tab-switch
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+tabs=$(i3-msg -t get_tree | grep -o '"window":[0-9]*[^{]*{[^}]*qutebrowser[^}]*}')
+selected_title=$(echo "$tabs" | sed 's/^.*title":"\(.*\) - qutebrowser.*/\1/g' | dmenu)
+selected_id=$(echo "$tabs" | grep "$selected_title" | sed 's/^.*window":\([0-9]*\).*$/\1/')
+i3-msg "[id=$selected_id] focus"
diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/zathura-open b/qutebrowser/.local/share/qutebrowser/userscripts/zathura-open
index 69b9dd1..088eff2 100755
--- a/qutebrowser/.local/share/qutebrowser/userscripts/zathura-open
+++ b/qutebrowser/.local/share/qutebrowser/userscripts/zathura-open
@@ -2,6 +2,5 @@
fname=/tmp/${RANDOM}.pdf
-echo ${QUTE_URL} > ~/testurl
-curl ${QUTE_URL} > ~/test.pdf
+curl ${QUTE_URL%.pdf}.pdf > ~/test.pdf
nohup zathura ~/test.pdf