[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

live-config 104-gnome-screensaver gconf > dconf



Hello

When building for Wheezy/Sid, the gconf command in live-config's
104-gnome-screensaver does not seem to produce the desired result. As
far as I can tell, the gconf key/value is set, but it is not moved to
dconf when 'gsettings-data-convert' is run, post login.

I am almost sure that including an equivalent 'sudo -u
"${LIVE_USERNAME}" gsettings set...' command directly from within
104-gnome-screensaver script will produce a bunch of authentication
errors, so I have included a patch that will create an
X-GNOME-Autostart-enabled desktop file within the live user's home
directory. I am not sure this is the ideal solution, but I thought I
would send the patch for review/discussion.

Cheers,
Philip
diff --git a/scripts/config/104-gnome-screensaver b/scripts/config/104-gnome-screensaver
index 202bc68..878ca97 100755
--- a/scripts/config/104-gnome-screensaver
+++ b/scripts/config/104-gnome-screensaver
@@ -37,6 +37,34 @@ Configure_gnome_screensaver ()
 	# Disabling to lock the screen when the screensaver goes active.
 	sudo -u "${LIVE_USERNAME}" gconftool-2 -t bool -s /apps/gnome-screensaver/lock_enabled false
 
+    # Same again, but for Wheezy+
+    if [ -x /usr/bin/gsettings ]; then
+
+        CONFIG_DIR="/home/${LIVE_USERNAME}/.config"
+        AUTOSTART_DIR="${CONFIG_DIR}/autostart"
+        AUTOSTART_FILE="disable-screensaver-lock.desktop"
+
+        if [ ! -d ${AUTOSTART_DIR} ]; then
+            mkdir -p ${AUTOSTART_DIR}
+        fi
+
+        if [ ! -e ${AUTOSTART_DIR}/${AUTOSTART_FILE} ]; then
+            cat > ${AUTOSTART_DIR}/${AUTOSTART_FILE} <<EOF
+[Desktop Entry]
+Type=Application
+Exec=gsettings set org.gnome.desktop.screensaver lock-enabled false
+Hidden=false
+X-GNOME-Autostart-enabled=true
+Name=Disable Screensaver Lock
+Comment=Disable screensaver lock for live sessions
+EOF
+
+        fi
+        
+        chown -R ${LIVE_USERNAME}:${LIVE_USERNAME} ${CONFIG_DIR}
+
+    fi
+
 	# Creating state file
 	touch /var/lib/live/config/gnome-screensaver
 }

Reply to: