Disable lid switch before suspending
This commit is contained in:
@@ -52,6 +52,10 @@ lock_and_screen_off() {
|
|||||||
reset_screen
|
reset_screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disable_lid_switch() {
|
||||||
|
grep "^${ACPI_LID_NAME}.*enabled" /proc/acpi/wakeup && echo " ${ACPI_LID_NAME}" | sudo tee /proc/acpi/wakeup
|
||||||
|
}
|
||||||
|
|
||||||
signal="$1"
|
signal="$1"
|
||||||
log "[I] Received signal \"$signal\"."
|
log "[I] Received signal \"$signal\"."
|
||||||
|
|
||||||
@@ -67,11 +71,13 @@ case "$signal" in
|
|||||||
suspend)
|
suspend)
|
||||||
log "[I] Suspending."
|
log "[I] Suspending."
|
||||||
lock &
|
lock &
|
||||||
|
disable_lid_switch
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
systemctl suspend
|
systemctl suspend
|
||||||
;;
|
;;
|
||||||
hibernate)
|
hibernate)
|
||||||
log "[I] Hibernating."
|
log "[I] Hibernating."
|
||||||
|
disable_lid_switch
|
||||||
systemctl hibernate
|
systemctl hibernate
|
||||||
;;
|
;;
|
||||||
reboot)
|
reboot)
|
||||||
|
|||||||
Reference in New Issue
Block a user