mirror of
https://github.com/basecamp/omarchy.git
synced 2026-01-09 05:10:54 +08:00
Add tweak to bring back suspend option to system menu
This commit is contained in:
parent
0b8bbdf01d
commit
9ae225a15a
@ -172,7 +172,7 @@ show_setup_menu() {
|
||||
local options=" Audio\n Wifi\n Bluetooth\n Power Profile\n Monitors"
|
||||
[ -f ~/.config/hypr/bindings.conf ] && options="$options\n Keybindings"
|
||||
[ -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
|
||||
*Audio*) omarchy-launch-audio ;;
|
||||
@ -186,6 +186,7 @@ show_setup_menu() {
|
||||
*DNS*) present_terminal omarchy-setup-dns ;;
|
||||
*Security*) show_setup_security_menu ;;
|
||||
*Config*) show_setup_config_menu ;;
|
||||
*Tweaks*) show_setup_tweaks_menu ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
@ -200,6 +201,14 @@ show_setup_power_menu() {
|
||||
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() {
|
||||
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 ;;
|
||||
@ -214,11 +223,17 @@ show_setup_config_menu() {
|
||||
esac
|
||||
}
|
||||
|
||||
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 ;;
|
||||
show_setup_tweaks_menu() {
|
||||
local options=""
|
||||
if [ -f ~/.local/state/omarchy/toggles/suspend-on ]; then
|
||||
options="$options Hide System Menu Suspend"
|
||||
else
|
||||
options="$options Reveal System Menu Suspend"
|
||||
fi
|
||||
|
||||
case $(menu "Tweaks" "$options") in
|
||||
*Suspend*) omarchy-toggle-suspend ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -493,9 +508,14 @@ show_update_password_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 ;;
|
||||
*Screensaver*) omarchy-launch-screensaver force ;;
|
||||
*Suspend*) systemctl suspend ;;
|
||||
*Restart*) omarchy-cmd-reboot ;;
|
||||
*Shutdown*) omarchy-cmd-shutdown ;;
|
||||
*) 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
|
||||
Loading…
x
Reference in New Issue
Block a user