Last active
January 4, 2019 09:10
-
-
Save Nklya/1e0f0b7ea1ccd7a0326bbdfe73f0aff0 to your computer and use it in GitHub Desktop.
Lock screen on power button
This file contains 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
event=button/power | |
action=/etc/acpi/power |
This file contains 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
#!/bin/sh | |
sudo -u <your-username> DISPLAY=:0 \ | |
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/<your-user-id>/bus \ | |
dbus-send --type=method_call --dest=org.gnome.ScreenSaver \ | |
/org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment