Created
March 11, 2019 05:25
-
-
Save premiso/55a97c2889a3732350915d89b3bc4970 to your computer and use it in GitHub Desktop.
In ArchLinux utilize polkit to allow suspending from cli after locking the screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Make sure user is in wheel group (usermod -aG wheel user | |
| // After that add this file under /etc/polkit-1/rules.d/49-suspend_nopass.rules | |
| // Then running (replacing dm-tool lock, with your locker): dm-tool lock; sleep 2; systemctl suspend | |
| // Will lock the screen and then suspend, no more people seeing random shit on you. | |
| //yay! | |
| polkit.addRule(function(action, subject) { | |
| if ((action.id == "org.freedesktop.login1.suspend" || | |
| action.id == "org.freedesktop.login1.set-wall-message") && | |
| subject.isInGroup("wheel")) | |
| { | |
| return polkit.Result.YES; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment