From 3e496795567bbdc9a29948d144866afb1be8f266 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Thu, 4 Jun 2015 20:59:35 +0200 Subject: [PATCH] move away from firefox --- local/bin/open.sh | 2 +- local/bin/qutemark | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 local/bin/qutemark diff --git a/local/bin/open.sh b/local/bin/open.sh index a48e109..28ce2de 100755 --- a/local/bin/open.sh +++ b/local/bin/open.sh @@ -2,4 +2,4 @@ curl -IL $1 \ | grep Content-Type \ | tail -n 1 \ - | grep image && feh $1 || firefox $1 + | grep image && feh $1 || xdg-open $1 diff --git a/local/bin/qutemark b/local/bin/qutemark new file mode 100755 index 0000000..91cbe62 --- /dev/null +++ b/local/bin/qutemark @@ -0,0 +1,30 @@ +#!/bin/bash + +qutemarks="/home/felix/.config/qutebrowser/qutemarks" +commands="$(echo -e "add\ndelete\ntabopen\nopen")" + +# Select a command +command="$(dmenu <<<"$commands")" +case "$command" in + "add") + echo "$QUTE_URL $QUTE_TITLE" >> "$qutemarks" + ;; + "delete") + to_remove="$(cat -n "$qutemarks" | sed 's/^ *//' | dmenu)" + [ -z "$to_remove" ] || sed -i "${to_remove%% *}d" "$qutemarks" + ;; + "tabopen") + opener="open -t" + ;; + "{tab,}open") + opener="open" + if [ "$command" = "tabopen" ]; then + opener="open -t" + fi + to_open="$(dmenu < "$qutemarks")" + echo "$command $to_open" >> "$QUTE_FIFO" + ;; + *) + ;; +esac +