[Xfce4-commits] <xfce4-session:master> Start screensaver with autostart.

Nick Schermer noreply at xfce.org
Sat Mar 24 22:50:10 CET 2012


Updating branch refs/heads/master
         to ccd9d7a93a85159c571518b12e326d1c7064f9c7 (commit)
       from 00915e5e3769b5a8afc3c340b538da2de70a9937 (commit)

commit ccd9d7a93a85159c571518b12e326d1c7064f9c7
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Feb 24 21:58:59 2012 +0100

    Start screensaver with autostart.
    
    Instead of the code in xinitrc, start xscreensaver using
    autostart. We don't care about gnome-screensaver.

 po/POTFILES.in                  |    1 +
 scripts/Makefile.am             |    7 +++++++
 scripts/xinitrc.in.in           |   28 +---------------------------
 scripts/xscreensaver.desktop.in |    9 +++++++++
 4 files changed, 18 insertions(+), 27 deletions(-)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7f84380..c9bd543 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -5,6 +5,7 @@ engines/balou/balou-theme.c
 engines/balou/config.c
 engines/mice/mice.c
 engines/simple/simple.c
+scripts/xscreensaver.desktop.in
 settings/main.c
 settings/session-editor.c
 settings/splash-settings.c
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 4a1c328..b8877ed 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -24,12 +24,19 @@ conffiles_DATA = \
 	xinitrc \
 	Xft.xrdb
 
+autostartdir = $(sysconfdir)/xdg/autostart
+autostart_in_files = xscreensaver.desktop.in
+autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
+ at INTLTOOL_DESKTOP_RULE@
+
 EXTRA_DIST = \
+	$(autostart_in_files) \
 	startxfce4.in \
 	xinitrc.in \
 	Xft.xrdb \
 	xflock4
 
 DISTCLEANFILES = \
+	$(autostart_DATA) \
 	startxfce4 \
 	xinitrc
diff --git a/scripts/xinitrc.in.in b/scripts/xinitrc.in.in
index 1395fb5..a85ac4a 100755
--- a/scripts/xinitrc.in.in
+++ b/scripts/xinitrc.in.in
@@ -184,35 +184,9 @@ if test "$ssh_agent_enabled" != "false"; then
 fi
 
 
-# launch a screensaver if enabled.  do not launch if we're root or if
-# we're in a VNC session.
-screensaver_enabled=`xfconf-query -c xfce4-session -p /startup/screensaver/enabled 2> /dev/null`
-if test $UID -gt 0 -a -z "$VNCSESSION" -a "$screensaver_enabled" != "false"; then
-    screensaver_type=`xfconf-query -c xfce4-session -p /startup/screensaver/type 2> /dev/null`
-
-    case "$screensaver_type" in
-        xscreensaver)
-            xscreensaver -no-splash &
-            ;;
-
-        gnome-screensaver)
-            gnome-screensaver &
-            ;;
-
-        *)
-            if test x"`which xscreensaver 2>/dev/null`" != x""; then
-                xscreensaver -no-splash &
-            elif test x"`which gnome-screensaver 2>/dev/null`" != x""; then
-                gnome-screensaver &
-            fi
-            ;;
-    esac
-fi
-
-
 # Run xfce4-session if installed
 if which xfce4-session >/dev/null 2>&1; then
-    ck-launch-session xfce4-session
+    xfce4-session
 
     if test "$ssh_agent_kill_cmd"; then
         echo "running '$ssh_agent_kill_cmd'"
diff --git a/scripts/xscreensaver.desktop.in b/scripts/xscreensaver.desktop.in
new file mode 100644
index 0000000..b18ba52
--- /dev/null
+++ b/scripts/xscreensaver.desktop.in
@@ -0,0 +1,9 @@
+
+[Desktop Entry]
+Type=Application
+_Name=Screensaver
+_Comment=Launch screensaver and locker program
+Icon=preferences-desktop-screensaver
+Exec=xscreensaver -no-splash
+TryExec=xscreensaver
+OnlyShowIn=XFCE;


More information about the Xfce4-commits mailing list