commit 7d0ce75f33b45664b343b7fee5888e3425319a14
parent aedb24b66f6f9adb40a4462d98a53d0433df1d43
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 15 Oct 2020 14:40:25 +0200
linkhandler: notifiers, tuir, use w3m for ycombinator
Readability doesn't work on Hacker News, so that gets opened in just
w3m. Reddit links are opened with tuir because that's why I have it
installed.
Former-commit-id: 0a7b646574091103d3e3ca386f9f1169ff140bb2
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/scripts/linkhandler b/scripts/linkhandler
@@ -3,15 +3,23 @@
case "$1" in
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*)
+ notify 'Starting mpv' "Opening $1..." 'linkhandler'
setsid -f mpvq "$1" 1>/dev/null 2>&1
;;
*png|*jpg|*jpe|*jpeg|*gif)
+ notify 'Starting sxiv' "Opening $1..." 'linkhandler'
curl -sL "$1" > "/tmp/$(printf "%s" "$1" | sed "s/.*\///")" \
&& sxiv -a "/tmp/$(printf "%s" "$1" | sed "s/.*\///")" 1>/dev/null 2>&1 &
;;
*mp3|*flac|*opus|*mp3?source*)
setsid -f mpva "$1"
;;
+ *news.ycombinator.com*)
+ w3m -config ~/.config/w3m/config "$1"
+ ;;
+ *reddit.com*)
+ tuir "$1"
+ ;;
http://*|https://*)
python3 -W ignore -m readability.readability -u "$1" | w3m -config ~/.config/w3m/config -T text/html
;;