Skip to content

Instantly share code, notes, and snippets.

@ravishi
Created October 1, 2014 15:05
Show Gist options
  • Save ravishi/c039081aae182c42407e to your computer and use it in GitHub Desktop.
Save ravishi/c039081aae182c42407e to your computer and use it in GitHub Desktop.
Fix "Lock screen" in ElementaryOS Freya
#!/bin/bash
# Stupidly simple script to fix the lockscreen option in ElementaryOS Freya.
# It listens to a dbus event and calls `dm-tool lock`.
#
# Run it in the background and lock your screen whenever you want!
#
# $ freya-lock-fix.sh &
# $ disown
# -> Lock screen
#
# Note that Super+L still doesn't work.
interface=com.canonical.Unity.Session
member=Lock
skip=0
dbus-monitor --profile "interface='$interface',member='$member'" |
while read -r line; do
if [ "$skip" == "0" ]; then
skip=1
else
dm-tool lock &
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment