diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-01-05 16:56:42 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-01-05 16:56:42 +0100 |
commit | e6e98313b9769b431d8a66c0aac2b82295d2bf1e (patch) | |
tree | 1cdbc2075815fa88a0b80818174542e00a41f855 /bin/guiscripts/sturl | |
parent | 541ab2e483efe77d08ae5d04119a834f24b6d150 (diff) | |
parent | 0d10205772b2745356969176de6f52510527e5a6 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/guiscripts/sturl')
-rwxr-xr-x | bin/guiscripts/sturl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index c738c8e..5b8b1e7 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,11 +1,11 @@ #!/bin/sh -regex='(((https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' -url="$(tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" +regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' +url="$(tr -d '\n' | grep -Eo "$regex" | tac | commander -cl)" [ -z "$url" ] && exit 1 case $1 in - 'c') echo -n "$url" | xclip -sel c -r ;; + 'c') printf '%s' "$url" | xclip -sel c -r ;; 'o') linkhandler "$url" ;; *) echo "no option" ;; esac |