init commit

This commit is contained in:
Luxferre
2026-10-19 09:23:54 +03:00
commit 6942acf5cf
307 changed files with 35003 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
usage() {
printf "usage: %s [reboot|poweroff|logout|togglewm]\n" "$(basename "$0")"
}
case "$1" in
reboot)
sxmo_hook_power.sh reboot || true
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
(sleep 5; doas /sbin/reboot -f >/dev/null 2>&1) &
doas /sbin/reboot || doas reboot || doas /sbin/reboot -f
;;
poweroff)
sxmo_hook_power.sh poweroff || true
sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
(sleep 5; doas /sbin/poweroff -f >/dev/null 2>&1) &
doas /sbin/poweroff || doas poweroff || doas /sbin/poweroff -f
;;
logout)
sxmo_hook_logout.sh || true
case "$SXMO_WM" in
"i3") i3-msg exit ;;
"sway") swaymsg exit ;;
"river") riverctl exit ;;
"dwm") pkill dwm ;;
esac
;;
togglewm) sxmo_togglewm.sh ;;
*)
usage
exit 1
;;
esac