mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add tweak to bring back suspend option to system menu
This commit is contained in:
@@ -172,7 +172,7 @@ show_setup_menu() {
|
|||||||
local options=" Audio\n Wifi\n Bluetooth\n Power Profile\n Monitors"
|
local options=" Audio\n Wifi\n Bluetooth\n Power Profile\n Monitors"
|
||||||
[ -f ~/.config/hypr/bindings.conf ] && options="$options\n Keybindings"
|
[ -f ~/.config/hypr/bindings.conf ] && options="$options\n Keybindings"
|
||||||
[ -f ~/.config/hypr/input.conf ] && options="$options\n Input"
|
[ -f ~/.config/hypr/input.conf ] && options="$options\n Input"
|
||||||
options="$options\n Defaults\n DNS\n Security\n Config"
|
options="$options\n Defaults\n DNS\n Security\n Config\n Tweaks"
|
||||||
|
|
||||||
case $(menu "Setup" "$options") in
|
case $(menu "Setup" "$options") in
|
||||||
*Audio*) omarchy-launch-audio ;;
|
*Audio*) omarchy-launch-audio ;;
|
||||||
@@ -186,6 +186,7 @@ show_setup_menu() {
|
|||||||
*DNS*) present_terminal omarchy-setup-dns ;;
|
*DNS*) present_terminal omarchy-setup-dns ;;
|
||||||
*Security*) show_setup_security_menu ;;
|
*Security*) show_setup_security_menu ;;
|
||||||
*Config*) show_setup_config_menu ;;
|
*Config*) show_setup_config_menu ;;
|
||||||
|
*Tweaks*) show_setup_tweaks_menu ;;
|
||||||
*) show_main_menu ;;
|
*) show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -200,6 +201,14 @@ show_setup_power_menu() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_setup_security_menu() {
|
||||||
|
case $(menu "Setup" " Fingerprint\n Fido2") in
|
||||||
|
*Fingerprint*) present_terminal omarchy-setup-fingerprint ;;
|
||||||
|
*Fido2*) present_terminal omarchy-setup-fido2 ;;
|
||||||
|
*) show_setup_menu ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
show_setup_config_menu() {
|
show_setup_config_menu() {
|
||||||
case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
case $(menu "Setup" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
||||||
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
||||||
@@ -214,11 +223,17 @@ show_setup_config_menu() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
show_setup_security_menu() {
|
show_setup_tweaks_menu() {
|
||||||
case $(menu "Setup" " Fingerprint\n Fido2") in
|
local options=""
|
||||||
*Fingerprint*) present_terminal omarchy-setup-fingerprint ;;
|
if [ -f ~/.local/state/omarchy/toggles/suspend-on ]; then
|
||||||
*Fido2*) present_terminal omarchy-setup-fido2 ;;
|
options="$options Hide System Menu Suspend"
|
||||||
*) show_setup_menu ;;
|
else
|
||||||
|
options="$options Reveal System Menu Suspend"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $(menu "Tweaks" "$options") in
|
||||||
|
*Suspend*) omarchy-toggle-suspend ;;
|
||||||
|
*) show_main_menu ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,9 +508,14 @@ show_update_password_menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show_system_menu() {
|
show_system_menu() {
|
||||||
case $(menu "System" " Lock\n Screensaver\n Restart\n Shutdown") in
|
local options=" Lock\n Screensaver"
|
||||||
|
[ -f ~/.local/state/omarchy/toggles/suspend-on ] && options="$options\n Suspend"
|
||||||
|
options="$options\n Restart\n Shutdown"
|
||||||
|
|
||||||
|
case $(menu "System" "$options") in
|
||||||
*Lock*) omarchy-lock-screen ;;
|
*Lock*) omarchy-lock-screen ;;
|
||||||
*Screensaver*) omarchy-launch-screensaver force ;;
|
*Screensaver*) omarchy-launch-screensaver force ;;
|
||||||
|
*Suspend*) systemctl suspend ;;
|
||||||
*Restart*) omarchy-cmd-reboot ;;
|
*Restart*) omarchy-cmd-reboot ;;
|
||||||
*Shutdown*) omarchy-cmd-shutdown ;;
|
*Shutdown*) omarchy-cmd-shutdown ;;
|
||||||
*) back_to show_main_menu ;;
|
*) back_to show_main_menu ;;
|
||||||
|
|||||||
13
bin/omarchy-toggle-suspend
Executable file
13
bin/omarchy-toggle-suspend
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
STATE_FILE=~/.local/state/omarchy/toggles/suspend-on
|
||||||
|
|
||||||
|
if [[ ! -f $STATE_FILE ]]; then
|
||||||
|
mkdir -p "$(dirname $STATE_FILE)"
|
||||||
|
touch $STATE_FILE
|
||||||
|
notify-send " Suspend now available in system menu"
|
||||||
|
else
|
||||||
|
mkdir -p "$(dirname $STATE_FILE)"
|
||||||
|
rm -f $STATE_FILE
|
||||||
|
notify-send " Suspend removed from system menu"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user