fix: suspend mode fixed

This commit is contained in:
hesam-init 2024-10-03 01:54:22 +03:30
parent 650a740959
commit 78a90ba9bf
3 changed files with 16 additions and 6 deletions

View file

@ -2,7 +2,7 @@
# Startup
# -----------------------------------------------------
# exec-once = [workspace 3 silent] nekoray
exec-once = [workspace 3 silent] $terminal -e bandwhich
exec-once = [workspace 3 silent] $terminal -e htop
exec-once = [workspace 3 silent] $terminal -e tty-clock -c
# exec-once = [workspace 3 silent] nekoray
# exec-once = [workspace 3 silent] $terminal -e bandwhich
# exec-once = [workspace 3 silent] $terminal -e tty-clock -c

View file

@ -98,14 +98,24 @@ confirm_run() {
fi
}
confirm_run_suspend() {
selected="$(confirm_exit)"
if [[ "$selected" == "$yes" ]]; then
hyprlock &
disown && loginctl suspend
else
exit
fi
}
# Execute Command
run_cmd() {
if [[ "$1" == '--opt1' ]]; then
sleep 1 && swaylock
sleep 1 && hyprlock
elif [[ "$1" == '--opt2' ]]; then
confirm_run 'hyprctl dispatch exit'
elif [[ "$1" == '--opt3' ]]; then
confirm_run 'loginctl suspend'
confirm_run_suspend
elif [[ "$1" == '--opt4' ]]; then
confirm_run 'loginctl hibernate'
elif [[ "$1" == '--opt5' ]]; then

@ -1 +1 @@
Subproject commit 1646d5742a802f89db58540efc3909fb28d1112c
Subproject commit 209e63f165140c2df2878ee4f1b6f287cee8cca8