From c3b58bc773b29492e6bed1eb02896d52ce1dda9a Mon Sep 17 00:00:00 2001 From: Denis Koleda Date: Sat, 23 Aug 2025 01:31:17 +1000 Subject: [PATCH] Use power button to open omarchy-menu system (#769) * Use power button to open omarchy-menu system * Added migration script * setsid so it doesn't exit with the terminal * Spacing --------- Co-authored-by: David Heinemeier Hansson --- default/hypr/bindings/utilities.conf | 1 + install.sh | 1 + install/config/ignore-power-button.sh | 5 +++++ migrations/1755208929.sh | 5 +++++ 4 files changed, 12 insertions(+) create mode 100755 install/config/ignore-power-button.sh create mode 100644 migrations/1755208929.sh diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index 6f089240..65ccd0d4 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -3,6 +3,7 @@ bindd = SUPER, SPACE, Launch apps, exec, walker -p "Start…" bindd = SUPER CTRL, E, Show clipboard, exec, walker -m Emojis bindd = SUPER ALT, SPACE, Omarchy menu, exec, omarchy-menu bindd = SUPER, ESCAPE, Power menu, exec, omarchy-menu system +bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings # Aesthetics diff --git a/install.sh b/install.sh index fc793750..5f8361de 100755 --- a/install.sh +++ b/install.sh @@ -75,6 +75,7 @@ source $OMARCHY_INSTALL/config/timezones.sh source $OMARCHY_INSTALL/config/login.sh source $OMARCHY_INSTALL/config/nvidia.sh source $OMARCHY_INSTALL/config/increase-sudo-tries.sh +source $OMARCHY_INSTALL/config/ignore-power-button.sh # Development source $OMARCHY_INSTALL/development/terminal.sh diff --git a/install/config/ignore-power-button.sh b/install/config/ignore-power-button.sh new file mode 100755 index 00000000..4166b9b3 --- /dev/null +++ b/install/config/ignore-power-button.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Disable shutting system down on power button to bind it to power menu afterwards +sudo sed -i 's/.*HandlePowerKey=.*/HandlePowerKey=ignore/' /etc/systemd/logind.conf + diff --git a/migrations/1755208929.sh b/migrations/1755208929.sh new file mode 100644 index 00000000..fa5b9f73 --- /dev/null +++ b/migrations/1755208929.sh @@ -0,0 +1,5 @@ +echo "Change behaviour of XF86PowerOff button to show omarchy system menu insead of shutting down immediately" + +source $OMARCHY_PATH/install/config/ignore-power-button.sh +setsid systemd-inhibit --what=handle-power-key --why="Temporary disable power button before restart" sleep infinity & +