This topic contains 7 replies, has 3 voices, and was last updated by oops May 10-2:18 am.
May 6, 2019 at 8:04 am #21202Member
What is the best way to have auto-suspend into antiX ?
I think what you need is in /etc/default/acpi-support. Look for this line
Code: Select all
# Uncomment this to enable ACPI sleep when the lid screen is closed.
and 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 ?
May 6, 2019 at 9:35 am #21208Member
- This topic was modified 2 weeks, 5 days ago by oops.
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
Thank you Caprea, perfect;
I have just to adapt this for a normal user (no root/sudo)
May 6, 2019 at 11:48 am #21236Member
- This reply was modified 2 weeks, 6 days ago by oops.
to grant permission for a normal user, you can
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
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:
#suspend after 15 min xautolock -time 15 -locker "sudo pm-suspend" &
May 6, 2019 at 12:44 pm #21243Member
- This reply was modified 2 weeks, 5 days ago by oops.
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
… 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
`#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 2 weeks, 2 days ago by oops.
You must be logged in to reply to this topic.