Pleng
Well-Known Member
- Joined
- Dec 28, 2006
- Messages
- 3,030
I'm working on a GUI that makes use of the XFCE panel and matchbox window manager, and I therefore need to be able to store an alternate version of XFCE's configuration settings. My startup script for the environment is hacked together with bits of .xinitrc and startxfce4 and looks like this:
I have highlighted in bold where I would have thought I had done enough to change the settings directory, but whenever I log into XFCE4, make some changes, and re login to ohhgui, the settings from XFCE are carried over.
Any ideas what I'm doing wrong?!!
Code:
#!/bin/sh
# set up XDG user directores. see
# http://freedesktop.org/wiki/Software/xdg-user-dirs
if type xdg-user-dirs-update >/dev/null 2>&1; then
xdg-user-dirs-update
fi
if test "x$XDG_CONFIG_HOME" = "x"
then
BASEDIR="$HOME/.config/oohgui/"
else
BASEDIR="$XDG_CONFIG_HOME/oohgui"
fi
if test "x$XDG_DATA_DIRS" = "x"
then
XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share"
else
XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share"
fi
export XDG_DATA_DIRS
if test "x$DISPLAY" = "x"
then
echo "$0: Starting X server"
prog=xinit
else
echo "$0: X server already running on display $DISPLAY"
prog=/bin/sh
fi
if test ! "x$*" = "x"
then
OPT=$*
if test "x${OPT#*--}" = "x${OPT}"
then
CLIENTRC=${OPT}
else
SERVERRC=${OPT#*-- }
CLIENTRC=${OPT% --*}
fi
fi
if [ -f "$HOME/.xserverrc" ]; then
SERVERRC="$HOME/.xserverrc $SERVERRC"
elif [ -f /etc/X11/xinit/xserverrc ]; then
SERVERRC="/etc/X11/xinit/xserverrc $SERVERRC"
fi
if test ! "x$SERVERRC" = "x"
then
SERVERRC="-- $SERVERRC"
fi
# fix broken $UID on some system...
if test "x$UID" = "x"; then
if test -x /usr/xpg4/bin/id; then
UID=`/usr/xpg4/bin/id -u`;
else
UID=`id -u`;
fi
fi
# $XDG_CONFIG_HOME defines the base directory relative to which user specific
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set
# or empty, a default equal to $HOME/.config should be used.
if test "x$XDG_CONFIG_HOME" = "x" ; then
XDG_CONFIG_HOME=$HOME/.config
fi
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"
# $XDG_CACHE_HOME defines the base directory relative to which user specific
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not
# set or empty, a default equal to $HOME/.cache should be used.
if test "x$XDG_CACHE_HOME" = "x" ; then
XDG_CACHE_HOME=$HOME/.cache
fi
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"
# Modify libglade and glade environment variables so that
# it will find the files installed by Xfce
export LIBGLADE_MODULE_PATH="$LIBGLADE_MODULE_PATH:/usr/lib/libglade/2.0"
export GLADE_CATALOG_PATH="$GLADE_CATALOG_PATH:"
export GLADE_PIXMAP_PATH="$GLADE_PIXMAP_PATH:"
export GLADE_MODULE_PATH="$GLADE_MODULE_PATH:"
# Export GTK_PATH so that GTK+ can find the Xfce theme engine
export GTK_PATH="$GTK_PATH:/usr/lib/gtk-2.0"
# For now, start with an empty list
XRESOURCES=""
# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r "/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES /etc/xdg/xfce4/Xft.xrdb"
test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"
[b]BASEDIR=$XDG_CONFIG_HOME/oohgui[/b]
if test -r "$BASEDIR/Xft.xrdb"; then
XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
elif test -r "$XFCE4HOME/Xft.xrdb"; then
mkdir -p "$BASEDIR"
cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi
# merge in X cursor settings
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"
# ~/.Xresources contains overrides to the above
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"
# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
cat /dev/null $XRESOURCES | xrdb -nocpp -merge -
# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
# Launch xscreensaver (if available), but only as non-root user
if test $UID -gt 0 -a -z "$VNCSESSION"; then
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
fi
# Use ssh-agent if installed and not already running. Run it separately
# so it populates the environment here, so we can clean it up later.
sshagent=`which ssh-agent`
kill_sshagent=0
if test -z "$SSH_AGENT_PID" -a "$sshagent" -a "x$sshagent" != "xno"; then
eval `$sshagent -s`
kill_sshagent=1
fi
# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
dbuslaunch=`which dbus-launch`
if test x"$dbuslaunch" != x"" -a x"$dbuslaunch" != x"no"; then
eval `$dbuslaunch --sh-syntax --exit-with-session`
fi
fi
xfsettingsd &
##add pleng
thunnar --daemon &
nm-applet &
matchbox-window-manager -use_titlebar no &
##more pleng
mkdir /tmp/Browser
cp $HOME/.scripts/plengui/* /tmp/Browser
thunar --name="Home" /tmp/Browser &
xfce4-panel
I have highlighted in bold where I would have thought I had done enough to change the settings directory, but whenever I log into XFCE4, make some changes, and re login to ohhgui, the settings from XFCE are carried over.
Any ideas what I'm doing wrong?!!