Forum › Forums › General › Tips and Tricks › [SOLVED]What is the best way to have auto-suspend into antiX ?
- This topic has 7 replies, 3 voices, and was last updated May 10-2:18 am by oops.
-
AuthorPosts
-
May 6, 2019 at 8:04 am #21202Member
oops
What is the best way to have auto-suspend into antiX ?
dolphin_oracle wrote:
I think what you need is in /etc/default/acpi-support. Look for this lineCode: Select all
# Uncomment this to enable ACPI sleep when the lid screen is closed.
#LID_SLEEP=trueand try uncommenting the LID_SLEEP line.
I have seen this tip & trick, and that’s work for the lid screen.
But I also would like to have an auto-suspend mode at, for example, after 15 minutes inactivity, and I do not seen any available options for “power management” into the “Control Center”, and ether.
So what is the best practice for antiX ?
Maybe :linrunner , or an other sofware like that ?
https://linrunner.de/en/tlp/tlp.html- This topic was modified 3 years, 12 months ago by oops.
May 6, 2019 at 9:35 am #21208Moderator
caprea
::If you’re just looking to auto-suspend after 15 minutes, you could try xautolock.
Install xautolock. Then add this to your startup-file in the hidden ./desktop-session folder in home
#suspend after 15 min xautolock -time 15 -locker "sudo pm-suspend" &May 6, 2019 at 10:04 am #21224Member
oops
::Thank you Caprea, perfect;
I have just to adapt this for a normal user (no root/sudo)- This reply was modified 4 years ago by oops.
May 6, 2019 at 11:48 am #21236Anonymous
::to grant permission for a normal user, you can
sudo visudo
or add a rule within /etc/sudoers.d/antixers
%users ALL=(root) NOPASSWD: /usr/bin/xautolock
(untested: may also need to grant /usr/sbin/pm-suspend )May 6, 2019 at 12:18 pm #21240Member
oops
::Thank you Skidoo, your are faster than me 😉 … I choose another way (your should work too):
Yes I have created a new file into /etc/sudoers.d/users-custom_pm-suspend
… and added:# sudoers file. #%users ALL=(root) NOPASSWD: /usr/sbin/pm-suspend #.. to add ...: #leafpad /etc/sudoers.d/users-custom_pm-suspend # then ... #chmod 440 /etc/sudoers.d/users-custom_pm-suspend user1-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend user2-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend user3-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend #... or for all user# #user5-antix ALL=(root) NOPASSWD: /usr/sbin/pm-suspend #ou #%users ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend… Then add for this user1 , to file:
/home/users1-antix/.desktop-session/startup#suspend after 15 min xautolock -time 15 -locker "sudo pm-suspend" &- This reply was modified 4 years ago by oops.
May 6, 2019 at 12:44 pm #21243Moderator
caprea
::Maybe I’m wrong, but I think because /usr/sbin/pm-suspend is already part of the /etc/sudoers.d/antixers-file,
the above step is not necessary, and it should work without.May 6, 2019 at 1:56 pm #21253Member
oops
::… Needed above steps here if the user is not root nor sudo.
$ inxi -Sxxxx System: Host: antix1 Kernel: 5.0.0 i686 bits: 32 compiler: gcc v: 6.3.0 Desktop: IceWM 1.4.2 info: icewmtray dm: SLiM 1.3.4 Distro: antiX-17.4.1_386-full Helen Keller 28 March 2019 base: Debian GNU/Linux 9 (stretch)May 10, 2019 at 2:18 am #21364Member
oops
::…
`#suspend after 15 min
xautolock -time 15 -locker “sudo pm-suspend” &`# into my ~/.desktop-session/startup # to get a locked screen after waking up your computer from suspend to RAM ... I finally also used i3lock: xautolock -time 15 -locker "i3lock -c 000000 && echo 'mem > /sys/power/state' && sudo pm-suspend" &- This reply was modified 3 years, 12 months ago by oops.
-
AuthorPosts
- You must be logged in to reply to this topic.