]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blobdiff - debian/guest-session-auto.sh
Skip guest warning dialog in MATE (LP: #1627395)
[sojka/lightdm.git] / debian / guest-session-auto.sh
index e50ec9451c9f39a19e8cac3be4d9e71e495eed4a..6c60dac625f83f686d778e0805757819d8adba8c 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2013 Canonical Ltd
+# Copyright (C) 2013-2016 Canonical Ltd
 # Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
 #
 # This program is free software: you can redistribute it and/or modify it under
 
 # This script is run via autostart at the launch of a guest session.
 
-TEXTDOMAINDIR=/usr/share/locale-langpack
-TEXTDOMAIN=lightdm
+export TEXTDOMAINDIR=/usr/share/locale-langpack
+export TEXTDOMAIN=lightdm
 
-# disable screen locking
+# disable screen locking (GNOME, Unity)
 gsettings set org.gnome.desktop.lockdown disable-lock-screen true
 
+# disable screen locking (MATE)
+gsettings set org.mate.screensaver lock-enabled false
+
+# disable screenlocking (XFCE, Pantheon)
+gsettings set apps.light-locker light-locker-enabled false
+gsettings set apps.light-locker late-locking false
+gsettings set apps.light-locker lock-on-lid false
+gsettings set apps.light-locker lock-on-suspend false
+
 # info dialog about the temporary nature of a guest session
 dialog_content () {
        TITLE=$(gettext 'Temporary Guest Session')
@@ -28,17 +37,28 @@ USB stick, if you would like to access them again later.')
 /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
+if [ ! -f "$HOME"/.skip-guest-warning-dialog ] && [ "$XDG_CURRENT_DESKTOP" != 'MATE' ]; then
+       if [ "$KDE_FULL_SESSION" = true ] && [ -x /usr/bin/kdialog ]; then
+               dialog_content
+               TEXT_FILE="$HOME"/.guest-session-kdialog
+               echo -n "$TEXT" > $TEXT_FILE
+               {
+                       # Sleep to wait for the the info dialog to start.
+                       # This way the window will likely become focused.
+                       sleep $DIALOG_SLEEP
+                       kdialog --title "$TITLE" --textbox $TEXT_FILE 450 250
+                       rm -f $TEXT_FILE
+               } &
+       elif [ -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
+                       sleep $DIALOG_SLEEP
                        zenity --warning --no-wrap --title="$TITLE" --text="$TEXT"
                } &
        fi
-}
+fi
 
 # run possible local startup commands
 test -f /etc/guest-session/auto.sh && . /etc/guest-session/auto.sh