summary refs log tree commit diff
path: root/bin/url-launcher
blob: 70b51c8b5a24d43db43d1a9b70ddee04143a95db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

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