From e7931fa50e051dc92928adfd4ba7d2a501f8c672 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Mon, 8 Apr 2019 17:50:44 +0200 Subject: [PATCH] Configure Pass with Qutebrowser + change font to hack --- dotfiles/qutebrowser.org | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dotfiles/qutebrowser.org b/dotfiles/qutebrowser.org index 30066a8..0b63755 100644 --- a/dotfiles/qutebrowser.org +++ b/dotfiles/qutebrowser.org @@ -86,7 +86,7 @@ c.downloads.remove_finished = 10000 * Fonts #+BEGIN_SRC conf # Default monospace fonts -c.fonts.monospace = '"SauceCodePro Nerd Font Mono" "xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal' +c.fonts.monospace = '"Hack Nerd Font Mono" "xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal' # Font used for prompts. c.fonts.prompts = '10pt monospace' @@ -877,7 +877,7 @@ c.url.start_pages = ['https://start.duckduckgo.com'] #+END_SRC ** Custom Bindings -Use Pass to fill password and username +Use Pass to fill password and username (configuration is done in =~/.config/qutebrowser/password_fill_rc=). #+BEGIN_SRC conf config.bind(',p', 'spawn --userscript password_fill') #+END_SRC @@ -922,3 +922,27 @@ echo "* TODO $QUTE_TITLE" >> ~/Dropbox/org/refile.org echo "$QUTE_URL" >> ~/Dropbox/org/refile.org echo "message-info 'Added to refile.org'" >> "$QUTE_FIFO" #+end_src +** Password_fill_rc + :PROPERTIES: + :header-args+: :tangle ~/.config/qutebrowser/password_fill_rc + :END: +#+begin_src bash + # Show all password fields in the menu + query_entries() { + # safe queried url for choose_entry + export queried_url="$1" + mapfile -t files < <(find -L "$PREFIX" -iname '*.gpg' -printf '%P\n' |sed 's,\.gpg$,,') + } + + # Even if there is only one entry, always show a menu + # for user confirmation. + choose_entry() { + MENU_COMMAND=( + rofi -dmenu + -p "qutebrowser> " + -filter "$queried_url" + -mesg $'Pick a password entry for '"${QUTE_URL//&/&}"'' + ) + file=$( printf "%s\n" "${files[@]}" | "${MENU_COMMAND[@]}" ) + } +#+end_src