[gnome-panel] add a wrapper script "gnome-session-flashback"



commit 4e2e5aa9c550ce86ca0fea85b0ea62b00a060f63
Author: Philipp Kaluza <phk src gnome org>
Date:   Mon Sep 23 19:06:27 2013 +0200

    add a wrapper script "gnome-session-flashback"
    
    ... and launch that from the X session description.
    
    This avoids listing parameters in the .desktop in a way which was
    problematic, and gives us a place to set up some logging when
    debugging gnome-session.

 data/Makefile.am                                   |    9 ++++-
 ...ack.desktop.in => gnome-fallback.desktop.in.in} |    4 +-
 gnome-panel/Makefile.am                            |   14 ++++++-
 gnome-panel/gnome-session-flashback.in             |   38 ++++++++++++++++++++
 4 files changed, 59 insertions(+), 6 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 368b8a2..95c9670 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -35,11 +35,15 @@ session_in_files = gnome-flashback.session.desktop.in
 session_DATA = $(session_in_files:.session.desktop.in=.session)
 
 xsessiondir = $(datadir)/xsessions
+xsession_in_in_files = gnome-fallback.desktop.in.in
 xsession_in_files = gnome-fallback.desktop.in
 xsession_DATA = $(xsession_in_files:.desktop.in=.desktop)
 
 %.session: %.session.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C 
$(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
 
+%.desktop.in: %.desktop.in.in
+       $(AM_V_GEN)sed -e 's,[ ]libexecdir[@],$(libexecdir),g' <$< >$@
+
 @INTLTOOL_DESKTOP_RULE@
 
 default_layoutdir   = $(datadir)/gnome-panel
@@ -48,7 +52,7 @@ default_layout_DATA = panel-default-layout.layout
 EXTRA_DIST =                           \
        $(gsettings_schemas_in_in)      \
        $(session_in_files)             \
-       $(xsession_in_files)            \
+       $(xsession_in_in_files)         \
        $(default_layout_DATA)
 
 CLEANFILES =                   \
@@ -57,6 +61,7 @@ CLEANFILES =                  \
        $(gsettings_SCHEMAS)    \
        *.gschema.valid         \
        $(session_DATA)         \
-       $(xsession_DATA)
+       $(xsession_DATA)        \
+       $(xsession_in_files)
 
 -include $(top_srcdir)/git.mk
diff --git a/data/gnome-fallback.desktop.in b/data/gnome-fallback.desktop.in.in
similarity index 59%
rename from data/gnome-fallback.desktop.in
rename to data/gnome-fallback.desktop.in.in
index 4856f75..66354a7 100644
--- a/data/gnome-fallback.desktop.in
+++ b/data/gnome-fallback.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 _Name=GNOME Flashback
 _Comment=This session logs you into GNOME with the traditional panel
-Exec=gnome-session --session=gnome-flashback
-TryExec=gnome-session
+Exec= libexecdir@/gnome-session-flashback
+TryExec= libexecdir@/gnome-session-flashback
 Icon=
 Type=Application
diff --git a/gnome-panel/Makefile.am b/gnome-panel/Makefile.am
index 15aa7b6..2679ccf 100644
--- a/gnome-panel/Makefile.am
+++ b/gnome-panel/Makefile.am
@@ -4,7 +4,8 @@ bin_PROGRAMS = \
        gnome-panel                     \
        gnome-desktop-item-edit         \
        panel-test-applets
-libexec_SCRIPTS = gnome-panel-add
+libexec_SCRIPTS = gnome-panel-add                              \
+                 gnome-session-flashback
 
 AM_CPPFLAGS =                                                  \
        $(PANEL_CFLAGS)                                         \
@@ -179,6 +180,14 @@ gnome-panel-add: gnome-panel-add.in Makefile
                < $< > $@
        $(AM_V_at)chmod a+x $@
 
+gnome-session-flashback: gnome-session-flashback.in Makefile
+       $(AM_V_GEN)sed                                          \
+               -e 's![ ]PACKAGE[@]!$(PACKAGE)!g'               \
+               -e 's![ ]VERSION[@]!$(VERSION)!g'               \
+               -e 's![ ]LIBEXECDIR[@]!$(libexecdir)!g'         \
+               < $< > $@
+       $(AM_V_at)chmod a+x $@
+
 panel_enum_headers =                                           \
        $(top_srcdir)/gnome-panel/panel-enums.h                 \
        $(top_srcdir)/gnome-panel/panel-enums-gsettings.h       \
@@ -276,7 +285,8 @@ CLEANFILES = \
        $(BUILT_SOURCES) \
        $(sys_DATA) \
        $(desktop_DATA) \
-       gnome-panel-add
+       gnome-panel-add \
+       gnome-session-flashback
 
 dist-hook:
        cd $(distdir) ; rm -f $(CLEANFILES)
diff --git a/gnome-panel/gnome-session-flashback.in b/gnome-panel/gnome-session-flashback.in
new file mode 100644
index 0000000..df97d7c
--- /dev/null
+++ b/gnome-panel/gnome-session-flashback.in
@@ -0,0 +1,38 @@
+#! /bin/sh
+#
+# gnome-session-flashback: gnome-session wrapper script for launching a Gnome Flashback session
+#
+# Copyright (C) 2013 Philipp Kaluza
+#
+# Authors: Philipp Kaluza <floss ghostroute eu>
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+PACKAGE="@PACKAGE@"
+VERSION="@VERSION@"
+LIBEXECDIR="@LIBEXECDIR@"
+
+if [ -w "$HOME/.xsession-errors-flashback" ] ; then
+       echo "gnome-session-flashback ($VERSION): attempting to launch" \
+            "gnome-session at $(date --iso-8601=seconds)" \
+            > "$HOME/.xsession-errors-flashback"
+       gnome-session --session=gnome-flashback "$@" 2>&1 | tee -a "$HOME/.xsession-errors-flashback"
+else
+       echo "gnome-session-flashback ($VERSION): attempting to launch" \
+            "gnome-session at $(date --iso-8601=seconds)" >&2
+       exec gnome-session --session=gnome-flashback "$@"
+fi
+


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