Skip to content

Instantly share code, notes, and snippets.

@jyc
Last active December 10, 2015 02:29
Show Gist options
  • Select an option

  • Save jyc/4368118 to your computer and use it in GitHub Desktop.

Select an option

Save jyc/4368118 to your computer and use it in GitHub Desktop.
#!/bin/zsh
if [[ $DESKTOP_SESSION == "KDE Plasma Workspace" ]]; then
qdbus org.kde.screensaver /ScreenSaver Lock
elif [[ $DESKTOP_SESSION == "Cinnamon" ]]; then
gnome-screensaver-command -a
else
xscreensaver-command --lock
fi
xset dpms force off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment