diff options
author | Gunnar Hjalmarsson <gunnarhj@ubuntu.com> | 2013-12-10 16:05:30 +0100 |
---|---|---|
committer | Gunnar Hjalmarsson <gunnarhj@ubuntu.com> | 2013-12-10 16:05:30 +0100 |
commit | 8bce845ac62312b93831e111af7beb9613c66ca7 (patch) | |
tree | fb7b97f1f4214a7705b176d89378ccff4c44383e /debian/guest-session-auto.sh | |
parent | 2e914fcd60b0a2921b811085fb14f64aa39f8408 (diff) | |
download | lightdm-8bce845ac62312b93831e111af7beb9613c66ca7.tar.gz |
Warn users about the temporary nature of a guest session.
Diffstat (limited to 'debian/guest-session-auto.sh')
-rw-r--r-- | debian/guest-session-auto.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/guest-session-auto.sh b/debian/guest-session-auto.sh new file mode 100644 index 00000000..e50ec945 --- /dev/null +++ b/debian/guest-session-auto.sh @@ -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 |