summaryrefslogtreecommitdiff
path: root/qutebrowser
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
parentd7260099e6b67e8161270d5b02ff30d00f8d61cd (diff)
[qutebrowser] Add script to change tabs
Diffstat (limited to 'qutebrowser')
-rw-r--r--qutebrowser/.config/qutebrowser/keys.conf7
-rw-r--r--qutebrowser/.config/qutebrowser/qutebrowser.conf10
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/tab-switch6
-rwxr-xr-xqutebrowser/.local/share/qutebrowser/userscripts/zathura-open3
4 files changed, 17 insertions, 9 deletions
diff --git a/qutebrowser/.config/qutebrowser/keys.conf b/qutebrowser/.config/qutebrowser/keys.conf
index 805bd58..8fd0d48 100644
--- a/qutebrowser/.config/qutebrowser/keys.conf
+++ b/qutebrowser/.config/qutebrowser/keys.conf
@@ -55,7 +55,10 @@ set-cmd-text -s :spawn --userscript url-from-surfraw
set-cmd-text -s :spawn --userscript url-from-surfraw -t
t
-set-cmd-text -s :spawn mpv {url}
+spawn --userscript tab-switch
+ T
+
+spawn mpv {url}
y
set-cmd-text :open {url}
@@ -125,7 +128,7 @@ back
forward
L
-hint
+hint all current
f
hint all tab
diff --git a/qutebrowser/.config/qutebrowser/qutebrowser.conf b/qutebrowser/.config/qutebrowser/qutebrowser.conf
index fe787c5..29edcc2 100644
--- a/qutebrowser/.config/qutebrowser/qutebrowser.conf
+++ b/qutebrowser/.config/qutebrowser/qutebrowser.conf
@@ -330,7 +330,7 @@ user-stylesheet =
hide-scrollbar = true
css-media-type =
smooth-scrolling = false
-remove-finished-downloads = -1
+remove-finished-downloads = 10
hide-statusbar = false
statusbar-padding = 1,1,0,0
window-title-format = {perc}{title}{title_sep}qutebrowser
@@ -691,7 +691,7 @@ position = top
show-favicons = false
width = 20%
indicator-width = 3
-tabs-are-windows = false
+tabs-are-windows = true
title-format = {index}: {title}
title-alignment = left
mousewheel-tab-switching = true
@@ -1399,11 +1399,11 @@ statusbar.url.fg.error = orange
statusbar.url.fg.warn = yellow
statusbar.url.fg.hover = aqua
tabs.fg.odd = white
-tabs.bg.odd = grey
+tabs.bg.odd = black
tabs.fg.even = white
-tabs.bg.even = darkgrey
+tabs.bg.even = black
tabs.fg.selected.odd = white
-tabs.bg.selected.odd = black
+tabs.bg.selected.odd = darkgreen
tabs.fg.selected.even = ${tabs.fg.selected.odd}
tabs.bg.selected.even = ${tabs.bg.selected.odd}
tabs.bg.bar = #555555
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