mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Add option to enable/disable hibernation (#4103)
* Add option to enable/disable hibernation * Actually do it * Match hibernation toggle words * Both enable and disable * Match the tense * Match options * Remove excess CR
This commit is contained in:
committed by
GitHub
parent
3a4536059a
commit
3dbebd7a4d
@@ -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\n Tweaks"
|
||||
options="$options\n DNS\n Security\n Config\n System"
|
||||
|
||||
case $(menu "Setup" "$options") in
|
||||
*Audio*) omarchy-launch-audio ;;
|
||||
@@ -182,11 +182,10 @@ show_setup_menu() {
|
||||
*Monitors*) open_in_editor ~/.config/hypr/monitors.conf ;;
|
||||
*Keybindings*) open_in_editor ~/.config/hypr/bindings.conf ;;
|
||||
*Input*) open_in_editor ~/.config/hypr/input.conf ;;
|
||||
*Defaults*) open_in_editor ~/.config/uwsm/default ;;
|
||||
*DNS*) present_terminal omarchy-setup-dns ;;
|
||||
*Security*) show_setup_security_menu ;;
|
||||
*Config*) show_setup_config_menu ;;
|
||||
*Tweaks*) show_setup_tweaks_menu ;;
|
||||
*System*) show_setup_system_menu ;;
|
||||
*) show_main_menu ;;
|
||||
esac
|
||||
}
|
||||
@@ -210,7 +209,8 @@ show_setup_security_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" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n Walker\n Waybar\n XCompose") in
|
||||
*Defaults*) open_in_editor ~/.config/uwsm/default ;;
|
||||
*Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;;
|
||||
*Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;;
|
||||
*Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;;
|
||||
@@ -219,21 +219,30 @@ show_setup_config_menu() {
|
||||
*Walker*) open_in_editor ~/.config/walker/config.toml && omarchy-restart-walker ;;
|
||||
*Waybar*) open_in_editor ~/.config/waybar/config.jsonc && omarchy-restart-waybar ;;
|
||||
*XCompose*) open_in_editor ~/.XCompose && omarchy-restart-xcompose ;;
|
||||
*) show_main_menu ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
show_setup_tweaks_menu() {
|
||||
show_setup_system_menu() {
|
||||
local options=""
|
||||
|
||||
if [ -f ~/.local/state/omarchy/toggles/suspend-on ]; then
|
||||
options="$options Hide System Menu Suspend"
|
||||
options="$options Disable Suspend"
|
||||
else
|
||||
options="$options Reveal System Menu Suspend"
|
||||
options="$options Enable Suspend"
|
||||
fi
|
||||
|
||||
case $(menu "Tweaks" "$options") in
|
||||
if omarchy-hibernation-available; then
|
||||
options="$options\n Disable Hibernate"
|
||||
else
|
||||
options="$options\n Enable Hibernate"
|
||||
fi
|
||||
|
||||
case $(menu "System" "$options") in
|
||||
*Suspend*) omarchy-toggle-suspend ;;
|
||||
*) show_main_menu ;;
|
||||
*"Enable Hibernate"*) present_terminal omarchy-hibernation-setup ;;
|
||||
*"Disable Hibernate"*) present_terminal omarchy-hibernation-remove ;;
|
||||
*) show_setup_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -510,12 +519,14 @@ show_update_password_menu() {
|
||||
show_system_menu() {
|
||||
local options=" Lock\n Screensaver"
|
||||
[ -f ~/.local/state/omarchy/toggles/suspend-on ] && options="$options\n Suspend"
|
||||
omarchy-hibernation-available && options="$options\n Hibernate"
|
||||
options="$options\n Restart\n Shutdown"
|
||||
|
||||
case $(menu "System" "$options") in
|
||||
*Lock*) omarchy-lock-screen ;;
|
||||
*Screensaver*) omarchy-launch-screensaver force ;;
|
||||
*Suspend*) systemctl suspend ;;
|
||||
*Hibernate*) systemctl hibernate ;;
|
||||
*Restart*) omarchy-cmd-reboot ;;
|
||||
*Shutdown*) omarchy-cmd-shutdown ;;
|
||||
*) back_to show_main_menu ;;
|
||||
|
||||
Reference in New Issue
Block a user