diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-18 18:07:38 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-18 18:38:21 +0100 |
| commit | f005fbf41646437964458d4c2028e6fdc04b59a1 (patch) | |
| tree | 2db56c1d202137278c5642ed418123b882d35dc5 /bin/url-launcher | |
| parent | 5e6e8da510836bbb0c7ac1602d51a394ba02ab2b (diff) | |
bin: add a few scripts
Diffstat (limited to 'bin/url-launcher')
| -rwxr-xr-x | bin/url-launcher | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/url-launcher b/bin/url-launcher index 02e23be..70b51c8 100755 --- a/bin/url-launcher +++ b/bin/url-launcher @@ -1,5 +1,21 @@ #!/bin/sh set -e -wl-copy "$@" -notify-send --urgency=low "copied" "$@" +text="$*" +if [ -z "$text" ]; then + read -r text +fi + +wl-copy "$text" +notify-send --urgency=low "copied" "$text" + +set -x +case "$text" in +*open.spotify.com*) notify-action -u low -c success -A "onclick=swaymsg exec -- spotify --uri=$text" "spotify link found" "$text" ;; + +url-launcher://*) + text=$(printf "%s" "$text" | sed -e 's,url-launcher://,,') + wl-copy "$text" + nuke "$text" + ;; +esac |