Skip to content

Commit

Permalink
Merge pull request #31 from erasche/kde-support
Browse files Browse the repository at this point in the history
Add support for KDE5 lockscreen detection
  • Loading branch information
karpathy committed Nov 23, 2015
2 parents 2d7f1ba + b1615d0 commit 111e860
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions logactivewin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ do
screensaverstate=$(xscreensaver-command -time | cut -f2 -d: | cut -f2-3 -d' ')
if [[ $screensaverstate =~ "screen non-blanked" ]]; then islocked=false; fi
elif [[ $GDMSESSION == 'ubuntu' || $GDMSESSION == 'ubuntu-2d' || $GDMSESSION == 'gnome-shell' || $GDMSESSION == 'gnome-classic' || $GDMSESSION == 'gnome-fallback' || $GDMSESSION == 'cinnamon' ]]; then
# Assume the GNOME/Ubuntu/cinnamon folks are using gnome-screensaver.
screensaverstate=$(gnome-screensaver-command -q 2>&1 /dev/null)
# Assume the GNOME/Ubuntu/cinnamon folks are using gnome-screensaver.
screensaverstate=$(gnome-screensaver-command -q 2>&1 /dev/null)
if [[ $screensaverstate =~ .*inactive.* ]]; then islocked=false; fi
elif [[ $XDG_SESSION_DESKTOP == 'KDE' ]]; then
islocked=$(qdbus org.kde.screensaver /ScreenSaver org.freedesktop.ScreenSaver.GetActive)
else
# If we can't find the screensaver, assume it's missing.
islocked=false
Expand Down

0 comments on commit 111e860

Please sign in to comment.