aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-12 10:44:00 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-06-12 11:02:17 +0200
commite3b4202b45f3a52dbb61632a9133f2dd0c1da343 (patch)
treee960b53135a0c8bdca4d3bd50ec6aa2691aed51d
parentccba9e587a8ac83061ae34a98c019d734a8b1f69 (diff)
downloadarctica-greeter-e3b4202b45f3a52dbb61632a9133f2dd0c1da343.tar.gz
arctica-greeter-e3b4202b45f3a52dbb61632a9133f2dd0c1da343.tar.bz2
arctica-greeter-e3b4202b45f3a52dbb61632a9133f2dd0c1da343.zip
Make guest account support functional. Port various items from Ubuntu's LightDM package.
-rw-r--r--Makefile.am8
-rwxr-xr-xarctica-guest-account-script.in (renamed from arctica-guest-account-script)6
-rwxr-xr-xarctica-guest-session-auto64
-rwxr-xr-xarctica-guest-session-setup33
-rw-r--r--data/50-arctica-greeter.conf.in3
-rw-r--r--data/50-arctica-guest-wrapper.conf.in2
-rw-r--r--data/Makefile.am20
-rw-r--r--data/arctica-guest-session-startup.desktop.in5
-rw-r--r--debian/50-arctica-greeter.conf2
-rw-r--r--debian/91-arctica-greeter-guest-session.conf2
-rw-r--r--debian/arctica-greeter-guest-session.install6
-rw-r--r--debian/arctica-greeter.install11
-rwxr-xr-xdebian/rules2
-rwxr-xr-xlightdm-arctica-greeter-session36
14 files changed, 190 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index 8035bf3..deac942 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,8 +2,15 @@
SUBDIRS = src data po tests
+arctica-guest-account-script: arctica-guest-account-script.in
+ $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+
sbin_SCRIPTS = arctica-guest-account-script
+pkglibexec_SCRIPTS = lightdm-arctica-greeter-session \
+ arctica-guest-session-auto \
+ arctica-guest-session-setup
+
EXTRA_DIST = \
autogen.sh \
arctica-greeter.doap
@@ -11,6 +18,7 @@ EXTRA_DIST = \
DISTCLEANFILES = \
Makefile.in \
aclocal.m4 \
+ arctica-guest-account-script \
configure \
config.h.in \
config.h \
diff --git a/arctica-guest-account-script b/arctica-guest-account-script.in
index f618390..577c4b6 100755
--- a/arctica-guest-account-script
+++ b/arctica-guest-account-script.in
@@ -77,8 +77,8 @@ add_account ()
}
fi
- dist_gs=/usr/share/lightdm/guest-session
- site_gs=/etc/guest-session
+ dist_gs=/usr/share/arctica-greeter/guest-session
+ site_gs=/etc/arctica-greeter/guest-session
# create temporary home directory
mount -t tmpfs -o mode=700,uid=${GUEST_USER} none ${GUEST_HOME} || {
@@ -139,7 +139,7 @@ add_account ()
fi
# setup session
- su ${GUEST_USER} -c "env HOME=${GUEST_HOME} site_gs=${site_gs} ${dist_gs}/setup.sh"
+ su ${GUEST_USER} -c "env HOME=${GUEST_HOME} site_gs=${site_gs} @pkglibexecdir@/arctica-guest-session-setup"
# set possible local guest session preferences
source_local_prefs() {
diff --git a/arctica-guest-session-auto b/arctica-guest-session-auto
new file mode 100755
index 0000000..8377528
--- /dev/null
+++ b/arctica-guest-session-auto
@@ -0,0 +1,64 @@
+#!/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.
+
+export TEXTDOMAINDIR=/usr/share/locale-langpack
+export TEXTDOMAIN=lightdm
+
+# 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')
+ 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 [ "$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 $DIALOG_SLEEP
+ 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
diff --git a/arctica-guest-session-setup b/arctica-guest-session-setup
new file mode 100755
index 0000000..595d0bc
--- /dev/null
+++ b/arctica-guest-session-setup
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+HOME=${HOME:-$(getent passwd $(whoami) | cut -f6 -d:)}
+
+# disable some services that are unnecessary for the guest session
+services="jockey-kde.desktop jockey-gtk.desktop update-notifier.desktop user-dirs-update-gtk.desktop"
+
+for service in ${services}; do
+ if [ -e /etc/xdg/autostart/${service} ]; then
+ [ -f ${HOME}/.config/autostart/${service} ] || cp /etc/xdg/autostart/${service} ${HOME}/.config/autostart
+ echo "X-GNOME-Autostart-enabled=false" >> ${HOME}/.config/autostart/${service}
+ fi
+done
+
+# disable Unity shortcut hint
+[ -d ${HOME}/.cache/unity ] || mkdir -p ${HOME}/.cache/unity
+touch ${HOME}/.cache/unity/first_run.stamp
+
+[ -d ${HOME}/.kde/share/config ] || mkdir -p ${HOME}/.kde/share/config
+echo "[Basic Settings]" >> ${HOME}/.kde/share/config/nepomukserverrc
+echo "Start Nepomuk=false" >> ${HOME}/.kde/share/config/nepomukserverrc
+
+echo "[Event]" >> ${HOME}/.kde/share/config/notificationhelper
+echo "hideHookNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper
+echo "hideInstallNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper
+echo "hideRestartNotifier=true" >> ${HOME}/.kde/share/config/notificationhelper
+
+# Load restricted session
+#dmrc='[Desktop]\nSession=guest-restricted'
+#/bin/echo -e ${dmrc} > ${HOME}/.dmrc
+
+# delay the launch of info dialog
+echo "export DIALOG_SLEEP=4" >> ${HOME}/.profile
diff --git a/data/50-arctica-greeter.conf.in b/data/50-arctica-greeter.conf.in
new file mode 100644
index 0000000..cac4c59
--- /dev/null
+++ b/data/50-arctica-greeter.conf.in
@@ -0,0 +1,3 @@
+[Seat:*]
+greeter-session=arctica-greeter
+greeter-wrapper=@pkglibexecdir@/lightdm-arctica-greeter-session
diff --git a/data/50-arctica-guest-wrapper.conf.in b/data/50-arctica-guest-wrapper.conf.in
new file mode 100644
index 0000000..1ccd04d
--- /dev/null
+++ b/data/50-arctica-guest-wrapper.conf.in
@@ -0,0 +1,2 @@
+[Seat:*]
+guest-wrapper=@libexecdir@/lightdm/lightdm-guest-session
diff --git a/data/Makefile.am b/data/Makefile.am
index 81f0ea6..af80b2a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,22 @@
# -*- Mode: Automake; indent-tabs-mode: t; tab-width: 4 -*-
+50-arctica-greeter.conf: 50-arctica-greeter.conf.in
+ $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+
+50-arctica-guest-wrapper.conf: 50-arctica-guest-wrapper.conf.in
+ $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
+lightdm_confdir = $(datadir)/lightdm/lightdm.conf.d
+lightdm_conf_DATA = \
+ 50-arctica-greeter.conf \
+ 50-arctica-guest-wrapper.conf
+
+arctica-guest-session-startup.desktop: arctica-guest-session-startup.desktop.in
+ $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@
+
+guestsession_autostartdir = $(datadir)/arctica-greeter/guest-session/skel/.config/autostart
+guestsession_autostart_DATA = arctica-guest-session-startup.desktop
+
xgreeterdir = $(datarootdir)/xgreeters
dist_xgreeter_DATA = arctica-greeter.desktop
@@ -64,5 +81,8 @@ EXTRA_DIST = \
$(gsettings_SCHEMAS)
DISTCLEANFILES = \
+ 50-arctica-greeter.conf \
+ 50-arctica-guest-wrapper.conf \
+ arctica-guest-session-startup.desktop \
Makefile.in \
logo.png
diff --git a/data/arctica-guest-session-startup.desktop.in b/data/arctica-guest-session-startup.desktop.in
new file mode 100644
index 0000000..c4d6d8d
--- /dev/null
+++ b/data/arctica-guest-session-startup.desktop.in
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=Custom startup command for Arctica Greeter's guest session
+Type=Application
+NoDisplay=true
+Exec=@pkglibexecdir@//arctica-guest-session-auto
diff --git a/debian/50-arctica-greeter.conf b/debian/50-arctica-greeter.conf
deleted file mode 100644
index d19ed15..0000000
--- a/debian/50-arctica-greeter.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-[Seat:*]
-greeter-session=arctica-greeter
diff --git a/debian/91-arctica-greeter-guest-session.conf b/debian/91-arctica-greeter-guest-session.conf
index 1c95904..54a3588 100644
--- a/debian/91-arctica-greeter-guest-session.conf
+++ b/debian/91-arctica-greeter-guest-session.conf
@@ -13,4 +13,4 @@ greeter-allow-guest=true
# if on Ubuntu and Unity is not installed, this is a minimal user session type for
# default (guest) sessions (sudo apt-get install openbox)
-user-session=openbox
+#user-session=openbox
diff --git a/debian/arctica-greeter-guest-session.install b/debian/arctica-greeter-guest-session.install
index d09fd2b..1cb5317 100644
--- a/debian/arctica-greeter-guest-session.install
+++ b/debian/arctica-greeter-guest-session.install
@@ -1,2 +1,6 @@
+etc/lightdm/lightdm.conf.d/91*
usr/sbin/arctica-guest-account-script
-etc/lightdm/lightdm.conf.d/91* \ No newline at end of file
+usr/lib/*/arctica-greeter/arctica-guest-session-auto
+usr/lib/*/arctica-greeter/arctica-guest-session-setup
+usr/share/lightdm/lightdm.conf.d/50-arctica-guest-wrapper.conf
+usr/share/arctica-greeter/guest-session/skel/.config/autostart/arctica-guest-session-startup.desktop \ No newline at end of file
diff --git a/debian/arctica-greeter.install b/debian/arctica-greeter.install
index 2dcf03c..1bbb38a 100644
--- a/debian/arctica-greeter.install
+++ b/debian/arctica-greeter.install
@@ -1,4 +1,13 @@
etc/lightdm/lightdm.conf.d/90-arctica-greeter.conf
usr/sbin/arctica-greeter
-usr/share/
+usr/share/arctica-greeter/*.png
+usr/share/arctica-greeter/*.svg
+usr/share/backgrounds/
+usr/share/glib-2.0/
+usr/share/lightdm/lightdm.conf.d/50-arctica-greeter.conf
+usr/share/locale/
+usr/share/man/
+usr/share/sounds/
+usr/share/xgreeters/
+usr/lib/*/arctica-greeter/lightdm-arctica-greeter-session
var/lib/polkit-1/localauthority/10-vendor.d/arctica-greeter.pkla
diff --git a/debian/rules b/debian/rules
index 6d90b03..4c0ff8f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,8 +18,6 @@ override_dh_auto_install:
dh_auto_install
mkdir -p debian/tmp/var/lib/polkit-1/localauthority/10-vendor.d/
cp debian/arctica-greeter.pkla debian/tmp/var/lib/polkit-1/localauthority/10-vendor.d/
- mkdir -p debian/tmp/usr/share/lightdm/lightdm.conf.d/
- cp debian/50-arctica-greeter.conf debian/tmp/usr/share/lightdm/lightdm.conf.d/
mkdir -p debian/tmp/etc/lightdm/lightdm.conf.d/
cp debian/90-arctica-greeter.conf debian/tmp/etc/lightdm/lightdm.conf.d/
cp debian/91-arctica-greeter-guest-session.conf debian/tmp/etc/lightdm/lightdm.conf.d/
diff --git a/lightdm-arctica-greeter-session b/lightdm-arctica-greeter-session
new file mode 100755
index 0000000..536e0ae
--- /dev/null
+++ b/lightdm-arctica-greeter-session
@@ -0,0 +1,36 @@
+#!/bin/sh
+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
+#
+# Copyright (C) 2011 Canonical Ltd
+# Author: Michael Terry <michael.terry@canonical.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 wrapper merely ensures that dbus-daemon lives only as long as this
+# script does. Otherwise, it's very easy for dbus-daemon to be autolaunched
+# and detached from the greeter.
+
+trap cleanup TERM EXIT
+
+cleanup()
+{
+ trap - TERM EXIT
+ if [ -n "$DBUS_SESSION_BUS_PID" ]; then
+ kill "$DBUS_SESSION_BUS_PID"
+ fi
+ if [ -n "$CMD_PID" ]; then
+ kill "$CMD_PID"
+ fi
+ exit 0
+}
+
+eval `dbus-launch --sh-syntax`
+
+exec $@ &
+CMD_PID=$!
+wait $CMD_PID
+CMD_PID=