~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.local/bin/statusbar/sb-dashboard -rw-r--r-- 675 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

# Ensure eww daemon is running
pgrep -x eww >/dev/null 2>&1 || eww daemon >/dev/null 2>&1 &

WINDOW="performance_monitor"
OVERLAY="dashboard_overlay"

# Display distro-specific Nerd Font icon in status bar
if [ -f /etc/arch-release ]; then
	printf '󰣇 \n'
elif [ -f /etc/gentoo-release ]; then
	printf ' \n'
else
	printf ' \n'
fi

case $BLOCK_BUTTON in
	1)
		if eww active-windows 2>/dev/null | grep -q "$WINDOW"; then
			eww update performance_monitor_visible=false
			eww close "$WINDOW" "$OVERLAY"
		else
			eww update performance_monitor_visible=true
			eww open "$OVERLAY"
			eww open "$WINDOW"
		fi
		;;
	3) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac