S
S
Skif White2015-08-27 07:20:00
linux
Skif White, 2015-08-27 07:20:00

How to teach Debian to fall asleep when laptop lid is closed?

In Tweak-Tool, in the power section, there is a configurable parameter for the reaction to pressing the Power button, there is also an entry "When the laptop is closed" but there is no selection menu. The laptop does not go to sleep when the lid is closed. Debian 8.1 Gnome
Asus K46CM

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2015-08-27
@Maxim_ka

For elementary, I wrote such a script, look in this direction, maybe it will help you.

#!/bin/bash  
 grep "HandleLidSwitch" /etc/systemd/logind.conf | grep ignore >/dev/null 2>&1  
 if [ $? -eq 0 ]; then  
     sed -i 's/HandleLidSwitch=ignore/HandleLidSwitch=suspend/' /etc/systemd/logind.conf && restart systemd-logind >/dev/null 2>&1; echo "Suspending enabled"   
 else  
     sed -i 's/HandleLidSwitch=suspend/HandleLidSwitch=ignore/' /etc/systemd/logind.conf && restart systemd-logind >/dev/null 2>&1; echo "Suspending disabled" 
 fi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question