[debian-edu-commits] debian-edu/ 07/183: Working profiles for GNOME, bit of a hack

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit dae5a5c636e4fd0b4b45454d404edce0ab8afc2d
Author: Bart Cornelis <cobaco at linux.be>
Date:   Thu Oct 14 19:58:25 2004 +0000

    Working profiles for GNOME, bit of a hack
---
 20activateDesktopProfiles | 25 +++++++++++++++++-----
 README                    | 54 ++++++++++++++++++++++++++++++++---------------
 debian/control            | 22 ++++++++++---------
 debian/rules              |  4 +++-
 default.listing           |  5 +++++
 path                      | 14 ++++++++++++
 6 files changed, 91 insertions(+), 33 deletions(-)

diff --git a/20activateDesktopProfiles b/20activateDesktopProfiles
index ac39008..92a25db 100644
--- a/20activateDesktopProfiles
+++ b/20activateDesktopProfiles
@@ -7,6 +7,7 @@
 ###############################################################################
 
 PROFILE_DIR="/etc/desktop-profiles";
+PROFILE_DIR="/home/cobaco/projects/debian-edu/src/desktop-profiles";
 LISTINGS=`ls $PROFILE_DIR/*.listing`;
 
 ######################################################################
@@ -123,10 +124,10 @@ get_profiles_with_fulfilled_requirements () {
   done;
 }
 
-######################################
+#################################################
 # $1 = Profile-kind 
-#      (KDE, XDG_DATA, or XDG_CONFIG)
-######################################
+#      (KDE, ROX, GCONF, XDG_DATA or XDG_CONFIG)
+#################################################
 getProfiles() {
   #################
   # order profiles
@@ -137,7 +138,11 @@ getProfiles() {
     # output the profile-root if this is the right profile kind
     ############################################################
     if echo -n `echo "$PROFILE" | cut --fields 5 --delimiter ";"` | grep $1 > /dev/null; then
-      echo -n "`echo "$PROFILE" | cut --fields 2 --delimiter ";"` ";
+      if (test "$1" != "GCONF"); then
+        echo -n "`echo "$PROFILE" | cut --fields 2 --delimiter ";"` ";
+      else	
+        echo "`echo "$PROFILE" | cut --fields 2 --delimiter ";"` ";
+      fi;	
     fi;
   done;  
 }
@@ -166,9 +171,19 @@ fi;
 
 CHOICESPATH==`getProfiles ROX | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
 if (test "$CHOICESPATH"x != x) &&
-   (test "$CHOICESPATH" != "`cat $CHOICESPATH/default.listing | grep "^default-choicespath" | cut --fields 2 --delimiter ";"`"); then
+   (test "$CHOICESPATH" != "`cat $PROFILE_DIR/default.listing | grep "^default-choicespath" | cut --fields 2 --delimiter ";"`"); then
   # Rox doesn't have a seperate variable for the user settings, they need to be added here
   # -> add default location for ROX user settings 
   CHOICESPATH=${HOME}/Choices:$CHOICESPATH
   export CHOICESPATH;
 fi;
+
+# HACK WARNING:
+# While GCONF allows multiple "configuration sources", there seems to be no way to make
+# the used "configuration sources" dependend on a condition (such as group membership).
+# To get around this we generate at login a path file with the directives for the active
+# profiles. For this to work the system-wide path file (/etc/gconf/2/path) needs to 
+# contain a include directive for this generated file. (if the default.listing file in
+# /etc/desktop-profiles is unchanged it should _only_ contain the include directive)
+PROFILE_PATH_FILE="/var/cache/desktop-profiles/${USER}_profiles.path"
+getProfiles GCONF > $PROFILE_PATH_FILE
diff --git a/README b/README
index 6869640..be7b9e6 100644
--- a/README
+++ b/README
@@ -3,27 +3,40 @@
 One general problem is that often you want to have different setups (profiles)
 when different conditions are met (e.g. IT-staff, vs. regular user). 
 
-Both KDE and freedesktop [Note] provide a way to add profiles by setting certain
-environment variables (KDEDIRS, XDG_CONFIG_DIRS, and XDG_DATA_DIRS). What's
-missing is a standard way to set those enviroment variables. This package
-provides a way to do just that.
- 
-	[Note] at least KDE, GNOME, ROX, an XFCE are working on support for the
-	       (growing number of) freedesktop standards.
+KDE, ROX, and freedesktop all natively provide a way to add profiles (by setting
+certain environment variables), GNOME can be made to support profiles (with a
+bit of a hack, and custom system-wide path file). This package provides a
+framework for using profiles with any and all these environments.
+
+Native profiles (KDE, GNOME, ROX) allow you to customize the respective 
+environment completely. Freedesktop profiles are currently rather limited but
+allow to configure things for multiple desktops at once (seems to be KDE, GNOME,
+ROX, and XFCE to varying degrees for the existing freedesktop standards)
 
 2. How it works:
 ================
-1. Anyone wanting to add a set of profiles can do so by placing a 
-   <set-name>.listing file in /etc/desktop-profiles. Each file contains the
-   metadata for set of profiles listed in that file. The Listed meta-data
-   consists of name, location, precedence, requirements to activate, 
-   profile-kind, and description (See 3. for the exact format of these files). 
+2.1. Anyone wanting to add a set of profiles can do so by placing a 
+     <set-name>.listing file in /etc/desktop-profiles. Each file contains the
+     metadata for set of profiles listed in that file. The Listed meta-data
+     consists of name, location, precedence, requirements to activate, 
+     profile-kind, and description (See 3. for the exact format of these files).
+
+     -> no need to mess with config files of other packages
 
-	-> no need to mess with config files of other packages
+2.2. When starting X an Xsession.d script is run that activates the profiles 
+     based on the data in the /etc/desktop-profiles/*.listing files 
+   
+     For KDE, ROX, an freedesktop profiles this means setting respectively the
+     KDEDIRS, CHOICESPATH, and XDG_DATA_DIRS + XDG_CONFIG_DIRS environment
+     variables.
 
-2. when starting X an Xsession.d script is run that sets the KDEDIRS, 
-   XDG_CONFIG_DIRS, and XDG_DATA_DIRS variables based on the data in the 
-   .listing files. 
+     The GCONF (i.e.GNOME) profile support is a bit of a hack, and needs the
+     system-wide gconf path file (/etc/gconf/2/path) to be replaced with  
+     /usr/share/doc/desktop-profiles/examples/path. This works by generating
+     a path file with the directives necesary for the profiles, and having
+     the system-wide path file contain (only) a directive to include the 
+     generated file. Out-of-the-box (without adding any extra profiles) this
+     gives the same behavior as the default GCONF-setup.
 
 3. Format of .listing files:
 ============================
@@ -33,7 +46,9 @@ provides a way to do just that.
    The 6 fields are as follows:
    - 1st field: Name of the profile, arbitrary, may be empty
    - 2nd field: Root of the profile directory tree. May contain more then one 
-                directory (if so seperate them with spaces)
+                directory (if so seperate them with spaces).
+		Except for the GCONF profiles, where this field contains the 
+		directive to be included in the generated path file.
    - 3th field: Precedence of the the profile, used to order the profiles when
                 multiple profiles are active. Empty = lowest precedence. This 
 		is mainly important if 2 active profiles define the same 
@@ -50,8 +65,10 @@ provides a way to do just that.
 	        - $(command) = the given shell command needs to exit succesfully
    - 5th field: The kind of profile. Must be set, and must be one of following:
                 - KDE        -> set KDEDIRS
+		- ROX	     -> set CHOICESPATH	
                 - XDG_CONFIG -> set XDG_CONFIG_DIRS
                 - XDG_DATA   -> set XDG_DATA_DIRS
+		- GCONF	     -> generate /var/cache/${USER}_profiles.path	
    - 6th field: A description of the profiles purpose, may be empty.
 
 4. Building profiles:
@@ -75,6 +92,9 @@ provides a way to do just that.
   - used by ROX desktop
   - user settings -> place / allow
 
+  4.4. GCONF "Configuration Sources":
+  ===================================
+
 5. FURTHER INFO:
 ================
 - About KDEDIRS, and the hierarchy of files in such a directory can be found
diff --git a/debian/control b/debian/control
index c2ad916..eb23fdf 100644
--- a/debian/control
+++ b/debian/control
@@ -9,15 +9,17 @@ Package: desktop-profiles
 Architecture: all
 Suggests: hicolor-icon-theme, shared-mime-info
 Description: Framework for setting up desktop profiles
- KDE, ROX, and freedesktop all provide a way to add profiles by setting certain
- environment variables (KDEDIRS, CHOICESPATH, XDG_CONFIG_DIRS + XDG_DATA_DIRS).
- This package provides a standard way to set those variables.
+ KDE, ROX, and freedesktop all natively provide a way to add profiles (by 
+ setting certain environment variables), GNOME can be made to support 
+ profiles (with a bit of a hack). This package provides a framework for
+ using profiles with any and all these environments.
  .
- Profiles are activated based on group membership and/or the succesfull 
- completion of arbitrary shell-command(s). Adding a new profile is as simple as
- dropping a file in /etc/desktop-profiles.
+ The framework allows profiles to be activated based on group membership and/or
+ the succesfull completion of arbitrary shell-command(s). Adding a new profile
+ is as simple as dropping a file in /etc/desktop-profiles.
  .
- Through KDEDIRS, and CHOICESPATH you can customize KDE completely. XDG_CONFIG_DIRS and 
- XDG_DATA_DIRS allow you to setup stuff according to the various freedesktop
- standards (see http://freedesktop.org/Standards) for all desktops that support
- them (KDE, GNOME, ROX, and XFCE in varying degrees).
+ Native profiles (KDE, GNOME, ROX) allow you to customize the respective 
+ environment completely. Freedesktop profiles are currently rather limited but
+ allow to configure things for multiple desktops at once (seems to be KDE, 
+ GNOME, ROX, and XFCE to varying degrees for the existing freedesktop standards)
+ Both KDE and GNOME profiles offer the ability to lock things down.
diff --git a/debian/rules b/debian/rules
index c468d6e..b8c834c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,8 +31,10 @@ binary-indep: build install
 	dh_testroot
 	dh_installchangelogs
 	dh_installdocs
+	dh_installexamples path
 	ln -s 20activateDesktopProfiles 20desktop-profiles_activateDesktopProfiles
 	dh_install 20desktop-profiles_activateDesktopProfiles etc/X11/Xsession.d/
+	rm 20desktop-profiles_activateDesktopProfiles
 	dh_install default.listing etc/desktop-profiles/
 	dh_compress
 	dh_fixperms
@@ -45,5 +47,5 @@ binary-indep: build install
 binary-arch: build install
 # We have nothing to do by default.
 
-binary: binary-indep 
+binary: binary-indep
 .PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/default.listing b/default.listing
index 9490796..2017ad7 100644
--- a/default.listing
+++ b/default.listing
@@ -13,3 +13,8 @@ kde-prefix;/usr;;;KDE;System-wide kde stuff on Debian
 default-xdg_config_dirs;/etc/xdg;;;XDG_CONFIG;Default config location defined by XDG Base Directory Specification
 default-xdg_data_dirs;/usr/local/share /usr/share;;;XDG_DATA;Default data locations defined by XDG Base Directory Specification
 default-choicespath;/usr/local/share/Choices /usr/share/Choices;;;ROX;Default locations for non-user settings of ROX programs
+
+gconf-mandatory;xml:readonly:/etc/gconf/gconf.xml.mandatory;3;;GCONF;Configuration source with the mandatory system-wide settings
+gconf-user-path;include $(HOME)/.gconf.path;2;;GCONF;Extra configuration sources specified by the user
+gconf-user;xml:readwrite:$(HOME)/.gconf;1;;GCONF;The normal user configuration source
+gconf-defaults;xml:readonly:/etc/gconf/gconf.xml.mandatory;;;GCONF;Configuration source with the default systemwide settings
diff --git a/path b/path
new file mode 100644
index 0000000..316d927
--- /dev/null
+++ b/path
@@ -0,0 +1,14 @@
+# System-Wide GConf path-file for use with desktop-profiles package
+#
+# Replacing the standard gconf path file (/etc/gconf/2/path) by this file 
+# generates the same behaviour as freshly-installed gnome. With only the 
+# default profiles in /etc/desktop-profiles/default.listing the generated file
+# will contain the following 4 directives (in the given order):
+#
+#	xml:readonly:/etc/gconf/gconf.xml.mandatory 
+#	include $(HOME)/.gconf.path 
+#	xml:readwrite:$(HOME)/.gconf 
+#	xml:readonly:/etc/gconf/gconf.xml.mandatory 
+#
+###############################################################################
+include "/var/cache/desktop-profiles/$(USER)_profiles.path"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list