lightdm: misc tweaks.

This commit is contained in:
Juan RP 2013-10-11 10:16:08 +02:00
parent d04cb8d871
commit 7edbe8ebf6
3 changed files with 4 additions and 69 deletions

View file

@ -5,7 +5,7 @@ Conflicts=getty@tty1.service
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service
[Service]
ExecStart=/usr/sbin/lightdm --log-dir=/var/log/lightdm --run-dir=/run/lightdm --cache-dir=/var/cache/lightdm
ExecStart=/usr/sbin/lightdm
Restart=always
IgnoreSIGPIPE=no
BusName=org.freedesktop.DisplayManager

View file

@ -1,55 +0,0 @@
# HG changeset patch
# Parent b329fa1badaa454239690c3feb93d53324134915
try to lock the screen before switching users
diff --git a/utils/gdmflexiserver b/utils/gdmflexiserver
--- utils/gdmflexiserver
+++ 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

View file

@ -1,7 +1,7 @@
# Template file for 'lightdm'
pkgname=lightdm
version=1.8.1
revision=1
revision=2
build_style=gnu-configure
configure_args="--with-greeter-session=lightdm-gtk-greeter
--with-greeter-user=lightdm --disable-static --disable-tests"
@ -31,19 +31,8 @@ post_install() {
vinstall ${FILESDIR}/lightdm.tmpfiles 644 usr/lib/tmpfiles.d lightdm.conf
vinstall ${FILESDIR}/lightdm.pam 644 etc/pam.d lightdm
vinstall ${FILESDIR}/lightdm-autologin.pam 644 etc/pam.d lightdm-autologin
vinstall ${FILESDIR}/xsession 755 etc/lightdm
vinstall ${FILESDIR}/lightdm.rules 644 usr/share/polkit-1/rules.d
# Minimum UID shall be 1000 for ordinary users.
sed -i -e "s|^\(minimum-uid=\).*|\11000|" \
${DESTDIR}/etc/lightdm/users.conf
# Provide a working session wrapper.
sed -i -e "s|#session-wrapper=lightdm-session|session-wrapper=/etc/lightdm/xsession|g" \
${DESTDIR}/etc/lightdm/lightdm.conf
# Provide a working PAM autologin service.
sed -i -e "s|#autologin-session=UNIMPLEMENTED|#autologin-session=UNIMPLEMENTED\n#pam-service=lightdm-autologin|g" \
${DESTDIR}/etc/lightdm/lightdm.conf
vinstall ${FILESDIR}/xsession 755 etc/lightdm Xsession
}
liblightdm-gobject_package() {
@ -81,6 +70,7 @@ lightdm_package() {
/etc/lightdm/lightdm.conf
/etc/lightdm/users.conf
/etc/pam.d/lightdm
/etc/pam.d/lightdm-greeter
/etc/pam.d/lightdm-autologin"
system_accounts="lightdm"
lightdm_homedir="/var/cache/lightdm"