Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bin/omarchy-system
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

# omarchy:summary=Log out, reboot, or shut down after closing applications
# omarchy:args=<logout|reboot|reboot-boot-menu|shutdown>
# omarchy:examples=omarchy system logout | omarchy system reboot | omarchy system reboot-boot-menu | omarchy system shutdown
# omarchy:args=<logout|reboot|shutdown>
# omarchy:examples=omarchy system logout | omarchy system reboot | omarchy system shutdown
# omarchy:aliases=omarchy logout | omarchy reboot | omarchy shutdown

usage="Usage: omarchy-system <logout|reboot|reboot-boot-menu|shutdown>"
usage="Usage: omarchy-system <logout|reboot|shutdown>"
for arg in "$@"; do
case $arg in
-h | --help) echo "$usage"; exit 0 ;;
Expand All @@ -20,7 +20,6 @@ action=${1:-}
case $action in
logout) command=(uwsm stop) ;;
reboot) command=(systemctl reboot --no-wall) ;;
reboot-boot-menu) icon="reboot"; command=(systemctl reboot --boot-loader-menu=0 --no-wall) ;;
shutdown) command=(systemctl poweroff --no-wall) ;;
*) echo "$usage" >&2; exit 2 ;;
esac
Expand All @@ -32,7 +31,7 @@ case $action in
failed_title=$(omarchy-i18n system.logoutFailed)
failed_body=$(omarchy-i18n system.logoutRetry)
;;
reboot | reboot-boot-menu)
reboot)
message=$(omarchy-i18n system.rebooting)
failed_title=$(omarchy-i18n system.rebootFailed)
failed_body=$(omarchy-i18n system.rebootRetry)
Expand All @@ -45,7 +44,7 @@ case $action in
esac

exit_session() {
omarchy-osd -i "${icon:-$action}" -m "$message" -d 5000
omarchy-osd -i "$action" -m "$message" -d 5000
if [[ $action != "logout" ]]; then
omarchy-state clear re*-required
fi
Expand Down
3 changes: 0 additions & 3 deletions default/i18n/en/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@
"system.reboot": {
"label": "Reboot"
},
"system.reboot-boot-menu": {
"label": "Reboot to Boot Menu"
},
"system.shutdown": {
"label": "Shutdown"
},
Expand Down
1 change: 0 additions & 1 deletion default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"system.hibernate": {"icon":"󰤁","label":"Hibernate","when":"omarchy-hibernation-available && ! omarchy-sleep-disabled","action":"systemctl hibernate"},
"system.logout": {"icon":"󰍃","label":"Logout","action":"omarchy-system logout"},
"system.reboot": {"icon":"󰜉","label":"Reboot","action":"omarchy-system reboot"},
"system.reboot-boot-menu": {"icon":"󰜉","label":"Reboot to Boot Menu","action":"omarchy-system reboot-boot-menu"},
"system.shutdown": {"icon":"󰐥","label":"Shutdown","action":"omarchy-system shutdown"},

// Learn
Expand Down
8 changes: 0 additions & 8 deletions test/shell.d/system-power-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,3 @@ for action in logout reboot shutdown; do
done
"$ROOT/bin/omarchy" system lock --help | grep -q 'omarchy-system-lock' || fail "system lock remains routed to its own command"
pass "existing system subcommands keep their routes"

# Last: this overwrites the shared worker file the sections above reuse.
run_power_command reboot-boot-menu || fail "reboot-boot-menu service is scheduled"
[[ -s $CALL_LOG.worker ]] || fail "reboot-boot-menu schedules its worker"
PATH=/stale/bin OMARCHY_PATH=/stale/checkout HYPRLAND_INSTANCE_SIGNATURE=stale /bin/bash "$CALL_LOG.worker" || fail "reboot-boot-menu worker succeeds"
grep -q '^systemctl reboot --boot-loader-menu=0 --no-wall$' "$call_log" || fail "reboot-boot-menu asks systemd for the boot loader menu"
grep -q '^omarchy-state clear re\*-required$' "$call_log" || fail "reboot-boot-menu clears restart state"
pass "reboot-boot-menu reboots into the boot loader menu through the graceful session exit"
Loading