dotfiles

My configuration files.
Log | Files | Refs | README

commit b3d3d3a71b9b7531cbbe700f810425baf54ce242
parent 2d01ff58bd845b2998c56bbdbc6c348b3589291b
Author: Sven Möller <sven-moeller@outlook.de>
Date:   Sat,  8 Jan 2022 18:37:44 +0100

Update config

Diffstat:
Mbash/.profile | 2+-
Mbin/.local/bin/bm | 2+-
Mbin/.local/bin/lh | 35++++++++++++++++++++++++++++++-----
Mnewsboat/.newsboat/config | 1+
Mqutebrowser/.config/qutebrowser/config.py | 4+++-
5 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/bash/.profile b/bash/.profile @@ -15,7 +15,7 @@ if [ "$(uname -o)" = "Android" ]; then else export TERMINAL=alacritty export BROWSER=qutebrowser - export LINK_HANDLER=lh + export LINK_HANDLER='lh open' export IMAGE_VIEWER=imv export NOTIFY=notify-send fi diff --git a/bin/.local/bin/bm b/bin/.local/bin/bm @@ -41,7 +41,7 @@ delete () { open () { url="$1" - "$LINK_HANDLER" "$url" + $LINK_HANDLER "$url" } interactive () { diff --git a/bin/.local/bin/lh b/bin/.local/bin/lh @@ -1,5 +1,8 @@ #!/bin/sh +gui=false +menu="fzf -i" + open () { url="$(echo "$1" | sed 's/?.*$//')" @@ -10,9 +13,10 @@ open () { esac } -qrcode () { - url="$1" - qrencode -t UTF8 "$url" +qr () { + [ $gui = true ] && \ + qrencode -o - "$1" | imv - || \ + qrencode -t UTF8 "$1" } clipboard () { @@ -26,5 +30,26 @@ download () { pandoc --verbose -o "$BM_DIR/saved/$name.epub" "$url" } -action="$(grep '^[a-z]\+ ()' $0 | sed 's/[^a-z]//g' | fzf)" -$action "$1" +bookmark () { + bm "$1" +} + +_choose () { + [ $gui = true ] && menu="dmenu" + action="$(grep '^[a-z]\+ ()' | sed 's/[^a-z]//g' | $menu)" + $action "$1" +} + +while [ $# -gt 0 ]; do + case $1 in + -g) gui=true ;; + -*) echo "Unknown option: $1" ;; + -o) open $2 ;; + *) + [ $# -eq 2 ] && "$1" "$2" && exit + [ $# -eq 1 ] && cat "$0" | _choose "$1" + ;; + esac + shift +done + diff --git a/newsboat/.newsboat/config b/newsboat/.newsboat/config @@ -36,3 +36,4 @@ bind-key S reload-all bind-key ESC quit bind-key o open-in-browser-and-mark-read bind-key M bookmark +macro o set browser "lh -g" ; open-in-browser ; set browser "$LINK_HANDLER" diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py @@ -18,6 +18,7 @@ c.url.searchengines = { 'ap': 'https://archlinux.org/packages/?q={}', 'aur': 'https://aur.archlinux.org/packages.php?K={}', 'aw': 'https://wiki.archlinux.org/?search={}', + 'ddg': 'https://duckduckgo.com/?q={}', 'gh': 'https://github.com/search?q={}', 'lg': 'http://libgen.li/search.php?req={}', 'w': 'https://en.wikipedia.org/w/index.php?search={}', @@ -34,4 +35,5 @@ config.bind('gh', 'home') config.bind('gr', 'spawn --userscript readability-js') config.bind('<Ctrl-b>', 'spawn -v wallabag add {url}') config.bind('<Ctrl-Shift-b>', 'spawn -v wallabag add --starred {url}') -config.bind('<Ctrl-s>', "open javascript:location.href='https://miniflux.svenmoeller.xyz/bookmarklet?uri='+encodeURIComponent(window.location.href)") +config.bind('<Ctrl-s>', 'spawn lh -g {url}') +config.bind(',s', 'hint links spawn lh -g {hint-url}')