qutebrowser: add fixlink userscript

This commit is contained in:
dogeystamp 2023-05-14 12:54:54 -04:00
parent 1aa82e083e
commit 12cf2f929b
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 26 additions and 0 deletions

View File

@ -102,3 +102,7 @@ c.hints.selectors["code"] = [
"pre"
]
config.bind("cc", "hint code userscript code_select.py")
# use libre redirects
config.bind(",fl", "hint links userscript fixlink.sh")
config.bind(",fL", "hint links userscript fixlink.sh -t")

View File

@ -0,0 +1,22 @@
#!/bin/sh
# libredirect but scuffed and a qutebrowser userscript
#
# bind something like this in config.py
#
# config.bind(",fl", "hint links userscript fixlink.sh")
# config.bind(",fL", "hint links userscript fixlink.sh -t")
#
REDDIT="lr.mint.lgbt"
TWITTER="nitter.net"
# genius lyrics
GENIUS="sing.whatever.social"
YOUTUBE="yewtu.be"
LINK="$(printf "%s" "$QUTE_URL" | sed \
-e "s/www.reddit.com/$REDDIT/g" \
-e "s/twitter.com/$TWITTER/g" \
-e "s/genius.com/$GENIUS/g" \
-e "s/youtube.com/$YOUTUBE/g")"
echo "open $1 $LINK" >> "$QUTE_FIFO"