1
0
Fork 0

Add support for pastebin URLs in urlhandler/readwwwlog

This commit is contained in:
tastytea 2022-04-16 13:46:05 +02:00
parent fc176f28b7
commit 0256d3d22b
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ for url in ${urls}; do
if [[ ${url} =~ 'dpaste\.com' && ! ${url[-4,-1]} == ".txt" ]]; then
url+=".txt"
fi
if [[ ${url} =~ 'pastebin.com' && ! ${url} =~ '/raw/' ]]; then
url="https://pastebin.com/raw/${url##*/}"
fi
if [[ ${TERMINAL} =~ "alacritty|xfce4-terminal" ]]; then
termopts="--title=${url}"

View File

@ -28,7 +28,7 @@ local -A assignments=(
'^https?://(www\.)?youtu(\.be|be\.com)/' "${mpv}"
'^(gemini|gopher)://' "kristall"
'\.(log|txt)$' "readwwwlog"
'^https?://dpaste\.com/' "readwwwlog"
'^https?://(dpaste|pastebin)\.com/' "readwwwlog"
)
local selected_cmd=${default_cmd}