From 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 Mon Sep 17 00:00:00 2001 From: Vito Graffagnino Date: Tue, 8 Sep 2020 18:10:49 +0100 Subject: Added the relevent parts of the .config directory. Alss add ssh config --- .../qutebrowser/misc/userscripts/dmenu_qutebrowser | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 .config/qutebrowser/misc/userscripts/dmenu_qutebrowser (limited to '.config/qutebrowser/misc/userscripts/dmenu_qutebrowser') diff --git a/.config/qutebrowser/misc/userscripts/dmenu_qutebrowser b/.config/qutebrowser/misc/userscripts/dmenu_qutebrowser new file mode 100755 index 0000000..82e6d2f --- /dev/null +++ b/.config/qutebrowser/misc/userscripts/dmenu_qutebrowser @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +# Copyright 2015 Zach-Button +# Copyright 2015-2017 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +# Pipes history, quickmarks, and URL into dmenu. +# +# If run from qutebrowser as a userscript, it runs :open on the URL +# If not, it opens a new qutebrowser window at the URL +# +# Ideal for use with tabs_are_windows. Set a hotkey to launch this script, then: +# :bind o spawn --userscript dmenu_qutebrowser +# +# 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 "o" to launch this script. For me, my workflow is: +# Default keys Keys with this script +# 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.) +# + +[ -z "$QUTE_URL" ] && QUTE_URL='http://google.com' + +url=$(echo "$QUTE_URL" | cat - "$QUTE_CONFIG_DIR/quickmarks" "$QUTE_DATA_DIR/history" | dmenu -l 15 -p qutebrowser) +url=$(echo "$url" | sed -E 's/[^ ]+ +//g' | grep -E "https?:" || echo "$url") + +[ -z "${url// }" ] && exit + +echo "open $url" >> "$QUTE_FIFO" || qutebrowser "$url" -- cgit v1.2.3