3 # Copyright (C) 2013 Canonical Ltd
4 # Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
6 # This program is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free Software
8 # Foundation, version 3 of the License.
10 # See http://www.gnu.org/copyleft/gpl.html the full text of the license.
12 # This script is run via autostart at the launch of a guest session.
14 TEXTDOMAINDIR=/usr/share/locale-langpack
17 # disable screen locking
18 gsettings set org.gnome.desktop.lockdown disable-lock-screen true
20 # info dialog about the temporary nature of a guest session
22 TITLE=$(gettext 'Temporary Guest Session')
23 TEXT=$(gettext 'All data created during this guest session will be deleted
24 when you log out, and settings will be reset to defaults.
25 Please save files on some external device, for instance a
26 USB stick, if you would like to access them again later.')
27 para2=$(gettext 'Another alternative is to save files in the
28 /var/guest-data folder.')
29 test -w /var/guest-data && TEXT="$TEXT\n\n$para2"
31 test -f "$HOME"/.skip-guest-warning-dialog || {
32 if [ "$KDE_FULL_SESSION" = true ] && [ -x /usr/bin/kdialog ]; then
34 TEXT_FILE="$HOME"/.guest-session-kdialog
35 echo -n "$TEXT" > $TEXT_FILE
37 # Sleep to wait for the the info dialog to start.
38 # This way the window will likely become focused.
40 kdialog --title "$TITLE" --textbox $TEXT_FILE 450 250
43 elif [ -x /usr/bin/zenity ]; then
46 # Sleep to wait for the the info dialog to start.
47 # This way the window will likely become focused.
49 zenity --warning --no-wrap --title="$TITLE" --text="$TEXT"
54 # run possible local startup commands
55 test -f /etc/guest-session/auto.sh && . /etc/guest-session/auto.sh