dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 3dadd10db1fc20e60e48741d040452ca868fa41a
parent 3ef3b8e4e2ee7c9e060fdd163752a71fbba33c4b
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 30 Jul 2019 09:13:17 +0200

Various link handling improvements

Diffstat:
M.config/sxhkd/sxhkdrc | 110++++++++++++++++++++++++++++++++++++++++---------------------------------------
M.local/bin/articlesearch | 4+++-
M.local/bin/linkhandler | 10++++++++--
M.local/bin/showclip | 4++--
4 files changed, 69 insertions(+), 59 deletions(-)

diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -1,112 +1,114 @@ # utils super + q - kill -9 `xdotool getwindowfocus getwindowpid` + kill -9 `xdotool getwindowfocus getwindowpid` super + space - ducksearch + ducksearch alt + space - dmenu_run + dmenu_run super + a - articlesearch + articlesearch super + o - $TERMINAL fuzzylaunch + $TERMINAL fuzzylaunch super + p - $TERMINAL dropdowncalc + $TERMINAL dropdowncalc +super + u + linkhandler $(xclip -o) super + shift + c - showclip + showclip super + alt + c - xcqr + xcqr super + grave - dmenuunicode + dmenuunicode super + Scroll_Lock - killall screenkey || screenkey + killall screenkey || screenkey super + x - xlock + xlock super + shift + slash - define --gui + define --gui super + shift + p - passmenu + passmenu Print - maim ~/tmp/pic-full-"$(date '+%y%m%d-%H%M-%S').png" + maim ~/tmp/pic-full-"$(date '+%y%m%d-%H%M-%S').png" super + Print - maimpick + maimpick super + {Print,Delete} - dmenurecord {,kill} + dmenurecord {,kill} XF86Launch1 - xrandr-auto; xbacklight -set 100 + xrandr-auto; xbacklight -set 100 shift + XF86Launch1 - xrandr-auto; xbacklight -set 1 + xrandr-auto; xbacklight -set 1 super + F5 - $TERMINAL -e nmtui-connect - #$TERMINAL -e sudo wpa_cli + $TERMINAL -e nmtui-connect + #$TERMINAL -e sudo wpa_cli XF86WLAN - $TERMINAL -e nmtui-connect - #$TERMINAL -e sudo wpa_cli + $TERMINAL -e nmtui-connect + #$TERMINAL -e sudo wpa_cli super + shift + F5 - sudo systemctl restart NetworkManager + sudo systemctl restart NetworkManager super + F7 - displayselect + displayselect XF86Display - displayselect + displayselect super + F8 - t-daemon-toggle + t-daemon-toggle super + {F9,F10} - {dmenumount,dmenuumount} + {dmenumount,dmenuumount} super + F11 - contactmenu + contactmenu super + alt + l - keyboard-layout-switch.sh; dwmstatus-refresh + keyboard-layout-switch.sh; dwmstatus-refresh # applications super + Return - $TERMINAL -e tmux + $TERMINAL -e tmux super + shift + Return - $TERMINAL + $TERMINAL super + e - $TERMINAL -e tmux new-session $EDITOR + $TERMINAL -e tmux new-session $EDITOR super + w - $BROWSER 'https://adamsgaard.dk/bookmark.html' + $BROWSER 'https://adamsgaard.dk/bookmark.html' super + shift + w - tor-browser + tor-browser super + b - $TERMINAL -e board ~/doc + $TERMINAL -e board ~/doc super + n - $TERMINAL -e $FILE + $TERMINAL -e $FILE super + m - $TERMINAL -e tmux new-session mutt + $TERMINAL -e tmux new-session mutt super + r - $TERMINAL -e newsboat + $TERMINAL -e newsboat super + i - $TERMINAL -e tmux new-session irc.sh + $TERMINAL -e tmux new-session irc.sh super + s - firejail --profile=~/.config/firejail/signal-desktop.profile signal-desktop + firejail --profile=~/.config/firejail/signal-desktop.profile signal-desktop super + t - message -p + message -p super + shift + o - $TERMINAL -e htop + $TERMINAL -e htop super + alt + t - textqr + textqr super + y - $TERMINAL -e tmux new-session 'cd ~/tmp && youtube-viewer' + $TERMINAL -e tmux new-session 'cd ~/tmp && youtube-viewer' super + shift + y - $TERMINAL -e tmux new-session 'cd ~/tmp && youtube-viewer --novideo' + $TERMINAL -e tmux new-session 'cd ~/tmp && youtube-viewer --novideo' super + c - $TERMINAL -e calcurse -D ~/.config/calcurse + $TERMINAL -e calcurse -D ~/.config/calcurse # media super + shift + a - $TERMINAL -e pulsemixer + $TERMINAL -e pulsemixer super + control + shift + c - mpv --no-osc --input-conf=/dev/null --title='mpvfloat' /dev/video0 + mpv --no-osc --input-conf=/dev/null --title='mpvfloat' /dev/video0 super + control + shift + m - $TERMINAL -e ncmpcpp + $TERMINAL -e ncmpcpp super + control + shift + {p,s,n,b} - mpc {toggle,stop,next,prev}; dwmstatus-refresh + mpc {toggle,stop,next,prev}; dwmstatus-refresh XF86AudioMute - pulsemixer --toggle-mute; dwmstatus-refresh + pulsemixer --toggle-mute; dwmstatus-refresh XF86Audio{Lower,Raise}Volume - pulsemixer --unmute --change-volume {-3,+3}; dwmstatus-refresh + pulsemixer --unmute --change-volume {-3,+3}; dwmstatus-refresh XF86MonBrightness{Down,Up} - xbacklight -{dec,inc} 5 + xbacklight -{dec,inc} 5 shift + XF86MonBrightness{Down,Up} - xbacklight -set {1,100} + xbacklight -set {1,100} diff --git a/.local/bin/articlesearch b/.local/bin/articlesearch @@ -6,7 +6,7 @@ dir="$HOME/articles $HOME/books" query="$(find $dir -type f | sed "s|$HOME/||" | dmenu_themed -i -l 10 -p "Search publications:")" || exit 1 -action="$(printf "Open\nSci-Hub\nAdd citation" | dmenu_themed -i -p "Action:")" +action="$(printf "Open\nGet DOI\nSci-Hub\nAdd citation" | dmenu_themed -i -p "Action:")" if [ "$action" = "Open" ]; then if [ -f "$HOME/$query" ]; then @@ -14,6 +14,8 @@ if [ "$action" = "Open" ]; then else $browser "https://scholar.google.com/scholar?q=$query" fi +elif [ "$action" = "Get DOI" ]; then + getdoi -n -c "$query" elif [ "$action" = "Sci-Hub" ]; then getdoi "$query" | shdl --tor-socks --notify --open elif [ "$action" = "Add citation" ]; then diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler @@ -11,7 +11,7 @@ for url in "$@"; do "$TERMINAL" -e "$EDITOR $url" else #url="$(printf "%s" "$url" | sed 's|http.*://scholar\.google\..*url=||;s|&rt=.*$||')" - action="$(printf "Open\nOpen (Tor Browser)\nCopy\nDownload\nSci-Hub\nAdd reference\nPlay" | dmenu_themed -i -p "Action:")" + action="$(printf "Open\nOpen (Tor Browser)\nCopy URL\ncURL\nHtml to pdf\nSci-Hub\nAdd reference\nPlay" | dmenu_themed -i -p "Action:")" if [ "$action" = "Open" ]; then setsid xdg-open "$url" >/dev/null 2>&1 & elif [ "$action" = "Open (Tor Browser)" ]; then @@ -20,8 +20,14 @@ for url in "$@"; do printf "%s" "$url" | xclip elif [ "$action" = "Download" ]; then mkdir -p ~/tmp/ - cd ~/tmp/ || exit + cd ~/tmp/ || exit 1 setsid tsp curl -LO "$url" >/dev/null 2>&1 & + elif [ "$action" = "Html to pdf" ]; then + mkdir -p ~/tmp/ + #setsid tsp 'tmpfile="$(mktemp)" && \ + out="$HOME/tmp/html_to_pdf_$(date +'%F-%T')".pdf && \ + wkhtmltopdf "$url" "$out" && \ + notify-send "$(basename $out) complete" elif [ "$action" = "Sci-Hub" ]; then setsid tsp shdl --tor-socks --notify --open --reference "$url" >/dev/null 2>&1 & elif [ "$action" = "Add reference" ]; then diff --git a/.local/bin/showclip b/.local/bin/showclip @@ -1,7 +1,7 @@ #!/bin/sh -clip=$(xclip -o -selection clipboard) prim=$(xclip -o -selection primary) +clip=$(xclip -o -selection clipboard) -[ -n "$clip" ] && notify-send "Clipboard (C-v, st)" "$clip" [ -n "$prim" ] && notify-send "Primary (middle click, Vim, Tmux)" "$prim" +[ -n "$clip" ] && notify-send "Clipboard (C-v, st)" "$clip"