~mil/sxmo-utils

ref: a5799bf3510d99513414d1bcd96279aa50a9e20a sxmo-utils/scripts/core/sxmo_wmtoggle.sh -rw-r--r-- 476 bytes
a5799bf3Stacy Harper Add a check before toggeling wm 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

not_ready_yet() {
	notify-send "Your device looks not ready yet"
	exit 1
}

case "$(realpath /var/lib/tinydm/default-session.desktop)" in
	/usr/share/wayland-sessions/swmo.desktop)
		command -v dwm || not_ready_yet
		sudo tinydm-set-session -f -s /usr/share/xsessions/sxmo.desktop
		pkill sway
		;;
	/usr/share/xsessions/sxmo.desktop)
		command -v sway || not_ready_yet
		sudo tinydm-set-session -f -s /usr/share/wayland-sessions/swmo.desktop
		pkill dwm
		;;
esac