Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
lightdm
lightdm-lock-screen-before-switch.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lightdm-lock-screen-before-switch.patch of Package lightdm
try to lock the screen before switching users diff --git a/utils/gdmflexiserver b/utils/gdmflexiserver --- a/utils/gdmflexiserver +++ b/utils/gdmflexiserver @@ -9,9 +9,47 @@ # # See http://www.gnu.org/copyleft/gpl.html for the full text of the license. +PATH=/usr/local/bin:/bin:/usr/bin +export PATH + if [ -z "$XDG_SEAT_PATH" ]; then # something went wrong exit 1 fi +find_command () { + cmd="$1" + oIFS="${IFS}"; IFS=: + set -- ${PATH} + IFS="${oIFS}" + + for part; do + [ -x "${part}/${cmd}" ] && return 0 + done + return 1 +} + +lock_screen () { + for lock_cmd in \ + "xscreensaver-command -lock" \ + "gnome-screensaver-command --lock" \ + "dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call /ScreenSaver org.freedesktop.ScreenSaver.Lock" + do + ${lock_cmd} >/dev/null 2>&1 && return + done + + for lock_cmd in \ + "slock" \ + "xlock -mode blank" + do + set -- ${lock_cmd} + if find_command "$1"; then + ${lock_cmd} >/dev/null 2>&1 & + return + fi + done +} + +lock_screen + dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $XDG_SEAT_PATH org.freedesktop.DisplayManager.Seat.SwitchToGreeter
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor