diff options
| author | Raymaekers Luca <luca@spacehb.net> | 2025-10-10 11:03:04 +0200 |
|---|---|---|
| committer | Raymaekers Luca <luca@spacehb.net> | 2025-10-10 11:03:04 +0200 |
| commit | da5908fe194a2036dcd1b1d9af70159acca63063 (patch) | |
| tree | 7ca9628b3345c1888b0f340a40ab3e6ff1d52054 /bin/menuscripts/mpower | |
| parent | 4f126573a547b5430962be6051b8705af281ff5a (diff) | |
checkpoint
Diffstat (limited to 'bin/menuscripts/mpower')
| -rwxr-xr-x | bin/menuscripts/mpower | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index 8cbf1d0..8886cfd 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,29 +1,41 @@ #!/bin/sh choice="$( -cat <<EOF | commander -c -w 1 -y 7 +cat <<EOF | commander -c -w 1 -y 8 poweroff suspend reboot firmware hibernate +windows EOF )" +# Same on both +case "$choice" in + "windows") + doas efibootmgr --bootnext "$(efibootmgr -u | grep 'Windows' | grep '^Boot[0-9]\{4\}' | cut -c 5-8)" + doas reboot + exit + ;; + "firmware") rebootfw; exit ;; +esac + +# Winter if [ "$(hostname)" = "winter" ]; then - if [ "$choice" = "firmware" ]; then - systemctl reboot --firmware-setup - elif [ "$choice" = "suspend" ]; then - systemctl hybrid-sleep - else - systemctl "$choice" - fi + case "$choice" in + "suspend") systemctl hybrid-sleep ;; + "") exit 1 ;; + *) systemctl "$choice" ;; + esac +# Spring elif [ "$(hostname)" = "spring" ]; then case "$choice" in "suspend") doas /usr/sbin/zzz -H ;; "hibernate") doas /usr/sbin/zzz -Z ;; "poweroff") doas /usr/sbin/poweroff ;; "reboot") doas /usr/sbin/reboot ;; - "firmware") rebootfw ;; + "windows") + ;; "") exit 1 ;; *) ;; esac |
