diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-06 09:40:11 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-03-06 09:40:11 +0100 |
commit | dd0c8a7f17010c3966cab08eab0b7fb0bfeda24e (patch) | |
tree | 249c74147493e85d5eefa59ed0989f51cd309bfc /bin | |
parent | b45ca4e7202f1cfb68fd22be6a8904e477e975c6 (diff) | |
parent | 368c78fdd6b9bfdc297bbbb5368d838d52ab0787 (diff) |
Merge remote-tracking branch 'refs/remotes/origin/main'
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/guiscripts/dmvid | 2 | ||||
-rwxr-xr-x | bin/guiscripts/linkhandler | 5 | ||||
-rwxr-xr-x | bin/guiscripts/sturl | 13 |
3 files changed, 12 insertions, 8 deletions
diff --git a/bin/guiscripts/dmvid b/bin/guiscripts/dmvid index ee7f865..16e164f 100755 --- a/bin/guiscripts/dmvid +++ b/bin/guiscripts/dmvid @@ -1,6 +1,6 @@ #!/usr/bin/env bash -find ${1:-~/movies ~/Downloads} 2> /dev/null | grep -E ".+\.(webm|mp4|mpeg|mkv)$" | sort > /tmp/dmvids +find ${1:-~/vids ~/dl} 2> /dev/null | grep -E ".+\.(webm|mp4|mpeg|mkv)$" | sort > /tmp/dmvids choice="$(\ sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmvids \ | awk '{printf "%s %s\n", NR ":", $0}' \ diff --git a/bin/guiscripts/linkhandler b/bin/guiscripts/linkhandler index a3a6b64..da2d656 100755 --- a/bin/guiscripts/linkhandler +++ b/bin/guiscripts/linkhandler @@ -6,11 +6,8 @@ # if a music file or pdf, it will download, # otherwise it opens link in browser. -if [ -z "$1" ]; then +test -z "${url:=$1}" && url="$(xclip -sel c -o)" -else - url="$1" -fi dunstify "linkhandler" "<b>handling</b> $url" case "$url" in diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index f7a3956..bf1fb02 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,4 +1,11 @@ #!/bin/sh -regex='\(ipfs:\|ipns:\|magnet:\|mailto:\|gemini:\|gopher:\|https:\|http:\|news:\|file:\|git:\|ssh:\|ftp:\)[^\<>"{-}\^`]\+' -url="$(grep "$regex" | sort | uniq | dmenu -g 1 -l 10 -x -c)" -linkhandler $url + +regex='(((https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' +url="$(cat | tr -d '\n' | grep -Eo "$regex" | dmenu -x -c -g 1 -l 10)" +[ -z "$url" ] && exit 1 + +case $1 in + 'c') echo -n "$url" | xclip -sel c -r ;; + 'o') linkhandler "$url" ;; + *) echo "no option" ;; +esac |