diff options
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 |