Skip to content

Instantly share code, notes, and snippets.

@premiso
Created March 11, 2019 05:25
Show Gist options
  • Save premiso/55a97c2889a3732350915d89b3bc4970 to your computer and use it in GitHub Desktop.
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
// 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