]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Warn users about the temporary nature of a guest session.
authorGunnar Hjalmarsson <gunnarhj@ubuntu.com>
Tue, 10 Dec 2013 15:05:30 +0000 (16:05 +0100)
committerGunnar Hjalmarsson <gunnarhj@ubuntu.com>
Tue, 10 Dec 2013 15:05:30 +0000 (16:05 +0100)
debian/guest-account
debian/guest-session-auto.sh [new file with mode: 0644]
debian/lightdm.install
debian/rules
po/POTFILES.in

index d4c119ea6da5b3420441a094d5e2b954b7aa31f8..fa4dfd6506623259905d6c6e6970901298993ca9 100644 (file)
@@ -71,10 +71,12 @@ add_account ()
     fi
   done
 
-  echo "[Desktop Entry]" >> "$HOME"/.config/autostart/screenlocking.desktop
-  echo "Name='Disable screen locking in guest session'" >> "$HOME"/.config/autostart/screenlocking.desktop
-  echo "Type=Application" >> "$HOME"/.config/autostart/screenlocking.desktop
-  echo "Exec=gsettings set org.gnome.desktop.lockdown disable-lock-screen true" >> "$HOME"/.config/autostart/screenlocking.desktop
+  STARTUP="$HOME"/.config/autostart/startup-commands.desktop
+  echo "[Desktop Entry]" > $STARTUP
+  echo "Name=Startup commands" >> $STARTUP
+  echo "Type=Application" >> $STARTUP
+  echo "NoDisplay=true" >> $STARTUP
+  echo "Exec=/usr/lib/lightdm/guest-session-auto.sh" >> $STARTUP
 
   mkdir -p "$HOME"/.kde/share/config
   echo "[Basic Settings]" >> "$HOME"/.kde/share/config/nepomukserverrc
diff --git a/debian/guest-session-auto.sh b/debian/guest-session-auto.sh
new file mode 100644 (file)
index 0000000..e50ec94
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (C) 2013 Canonical Ltd
+# Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, version 3 of the License.
+#
+# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
+
+# This script is run via autostart at the launch of a guest session.
+
+TEXTDOMAINDIR=/usr/share/locale-langpack
+TEXTDOMAIN=lightdm
+
+# disable screen locking
+gsettings set org.gnome.desktop.lockdown disable-lock-screen true
+
+# info dialog about the temporary nature of a guest session
+dialog_content () {
+       TITLE=$(gettext 'Temporary Guest Session')
+       TEXT=$(gettext 'All data created during this guest session will be deleted
+when you log out, and settings will be reset to defaults.
+Please save files on some external device, for instance a
+USB stick, if you would like to access them again later.')
+       para2=$(gettext 'Another alternative is to save files in the
+/var/guest-data folder.')
+       test -w /var/guest-data && TEXT="$TEXT\n\n$para2"
+}
+test -f "$HOME"/.skip-guest-warning-dialog || {
+       if [ -x /usr/bin/zenity ]; then
+               dialog_content
+               {
+                       # Sleep to wait for the the info dialog to start.
+                       # This way the window will likely become focused.
+                       sleep 2
+                       zenity --warning --no-wrap --title="$TITLE" --text="$TEXT"
+               } &
+       fi
+}
+
+# run possible local startup commands
+test -f /etc/guest-session/auto.sh && . /etc/guest-session/auto.sh
index 03a6e45363c9d6af5f29f697878c453da19a06ce..cdad60cc23ef4e904e3aa9ed97fc82a90dd3e2d7 100644 (file)
@@ -10,6 +10,7 @@ etc/lightdm/keys.conf usr/share/doc/lightdm/
 etc/apparmor.d
 debian/lightdm-session usr/sbin
 debian/guest-account usr/sbin
+debian/guest-session-auto.sh usr/lib/lightdm
 debian/lightdm-greeter-session usr/lib/lightdm
 debian/source_lightdm.py usr/share/apport/package-hooks
 debian/50-xserver-command.conf etc/lightdm/lightdm.conf.d
index 3c262e6a570a49cf7ab316b0c15a26280ae8cf50..0e141f946e8b10bb393b071187d929ce0a0baebd 100755 (executable)
@@ -22,6 +22,7 @@ override_dh_install:
        # we do install pam through installpam and init through installinit
        dh_install -X.a -X.la -Xpam.d -X'etc/init/lightdm.conf' --fail-missing
        chmod +x debian/lightdm/usr/lib/lightdm/lightdm-greeter-session
+       chmod +x debian/lightdm/usr/lib/lightdm/guest-session-auto.sh
 
 override_dh_installinit:
        dh_installinit --no-start
index 2668b565d521ba358f273b08f8cdde23e1109842..e9e99699315e71e8f28c9ffebb0a7002d49e6f6b 100644 (file)
@@ -1,5 +1,6 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 [encoding: UTF-8]
+debian/guest-session-auto.sh
 src/lightdm.c
 src/dm-tool.c