aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/senpai/.config/senpai/highlight
blob: f5c5ad3e8d3dad30e419d509cbf247e83a34357b (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/sh

escape() {
	printf "%s" "$1" | sed 's#\#\\#g'
}

FOCUS=$(swaymsg -t get_tree | jq '..|objects|select(.focused==true)|.name' | grep -c senpai)

if [ "$HERE" -eq 0 ] || [ "$FOCUS" -eq 0 ]; then
	notify-send "[$BUFFER] $SENDER" "$(escape "$MESSAGE")"
fi