Add a check before toggeling wm

Currently on 1.5.1, sway is not installed nor setted up. This WM toggle
entry cause a tty soft lock !

This fix this with a very too simple check but that will prevent this
case.
This commit is contained in:
Stacy Harper 2021-09-04 10:43:01 +02:00
parent 3c3c5f5b45
commit a5799bf351
No known key found for this signature in database
GPG key ID: 5BAC92328B7C5D65

View file

@ -1,11 +1,18 @@
#!/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
;;