3 # fix broken $UID on some system...
4 if test "x$UID" = "x"; then
5 if test -x /usr
/xpg
4/bin
/id
; then
6 UID
=`/usr/xpg4/bin/id -u`;
12 # set $XDG_MENU_PREFIX to "xfce-" so that "xfce-applications.menu" is picked
13 # over "applications.menu" in all Xfce applications.
14 if test "x$XDG_MENU_PREFIX" = "x"; then
15 XDG_MENU_PREFIX
="xfce-"
16 export XDG_MENU_PREFIX
19 # set DESKTOP_SESSION so that one can detect easily if an Xfce session is running
20 if test "x$DESKTOP_SESSION" = "x"; then
21 DESKTOP_SESSION
="xfce"
22 export DESKTOP_SESSION
25 # set XDG_CURRENT_DESKTOP so that Qt 5 applications can identify user set Xfce theme
26 if test "x$XDG_CURRENT_DESKTOP" = "x"; then
27 XDG_CURRENT_DESKTOP
="XFCE"
28 export XDG_CURRENT_DESKTOP
31 # $XDG_CONFIG_HOME defines the base directory relative to which user specific
32 # configuration files should be stored. If $XDG_CONFIG_HOME is either not set
33 # or empty, a default equal to $HOME/.config should be used.
34 if test "x$XDG_CONFIG_HOME" = "x" ; then
35 XDG_CONFIG_HOME
=$HOME/.config
37 [ -d "$XDG_CONFIG_HOME" ] || mkdir
"$XDG_CONFIG_HOME"
39 # $XDG_CACHE_HOME defines the base directory relative to which user specific
40 # non-essential data files should be stored. If $XDG_CACHE_HOME is either not
41 # set or empty, a default equal to $HOME/.cache should be used.
42 if test "x$XDG_CACHE_HOME" = "x" ; then
43 XDG_CACHE_HOME
=$HOME/.cache
45 [ -d "$XDG_CACHE_HOME" ] || mkdir
"$XDG_CACHE_HOME"
47 # set up XDG user directores. see
48 # http://freedesktop.org/wiki/Software/xdg-user-dirs
49 if which xdg-user-dirs-update
>/dev
/null
2>&1; then
53 # Modify libglade and glade environment variables so that
54 # it will find the files installed by Xfce
55 GLADE_CATALOG_PATH
="$GLADE_CATALOG_PATH:"
56 GLADE_PIXMAP_PATH
="$GLADE_PIXMAP_PATH:"
57 GLADE_MODULE_PATH
="$GLADE_MODULE_PATH:"
58 export GLADE_CATALOG_PATH
59 export GLADE_PIXMAP_PATH
60 export GLADE_MODULE_PATH
62 # For now, start with an empty list
65 # Has to go prior to merging Xft.xrdb, as its the "Defaults" file
66 test -r "/etc/xdg/xfce4/Xft.xrdb" && XRESOURCES
="$XRESOURCES /etc/xdg/xfce4/Xft.xrdb"
67 test -r $HOME/.Xdefaults
&& XRESOURCES
="$XRESOURCES $HOME/.Xdefaults"
69 BASEDIR
=$XDG_CONFIG_HOME/xfce4
70 if test -r "$BASEDIR/Xft.xrdb"; then
71 XRESOURCES
="$XRESOURCES $BASEDIR/Xft.xrdb"
72 elif test -r "$XFCE4HOME/Xft.xrdb"; then
74 cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
75 XRESOURCES
="$XRESOURCES $BASEDIR/Xft.xrdb"
78 # merge in X cursor settings
79 test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES
="$XRESOURCES $BASEDIR/Xcursor.xrdb"
81 # ~/.Xresources contains overrides to the above
82 test -r "$HOME/.Xresources" && XRESOURCES
="$XRESOURCES $HOME/.Xresources"
84 # load all X resources (adds /dev/null to avoid an empty list that would hang the process)
85 cat /dev
/null
$XRESOURCES | xrdb
-nocpp -merge -
88 test -r $HOME/.Xmodmap
&& xmodmap
$HOME/.Xmodmap
90 # run xfce4-session if installed
91 if which xfce4-session
>/dev
/null
2>&1; then
93 # check if we start xfce4-session with ck-launch-session. this is only
94 # required for starting from a console, not a login manager
95 if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
96 if which ck-launch-session
>/dev
/null
2>&1; then
97 ck-launch-session xfce4-session
100 echo "You have tried to start Xfce with consolekit support, but"
101 echo "ck-launch-session is not installed."
102 echo "Aborted startup..."
108 # start xfce4-session normally
119 # Everything below here ONLY gets executed if you are NOT using xfce4-session
120 # (Xfce's session manager). If you are using the session manager, everything
121 # below is handled by it, and the code below is not executed at all. If you're
122 # not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
123 # in a terminal while Xfce is running.
127 # Use dbus-launch if installed.
128 if test x
"$DBUS_SESSION_BUS_ADDRESS" = x
""; then
129 if which dbus-launch
>/dev
/null
2>&1; then
130 eval `dbus-launch --sh-syntax --exit-with-session`
131 # some older versions of dbus don't export the var properly
132 export DBUS_SESSION_BUS_ADDRESS
134 echo "Could not find dbus-launch; Xfce will not work properly" >&2
138 # this is only necessary when running w/o xfce4-session
139 xsetroot
-solid black
-cursor_name watch
141 # or use old-fashioned startup script otherwise
146 # start up stuff in $XDG_CONFIG_HOME/autostart/
147 if test -d "$XDG_CONFIG_HOME/autostart"; then
148 for i
in ${XDG_CONFIG_HOME}/autostart
/*.desktop
; do
149 grep -q -E "^Hidden=true" "$i" && continue
150 if grep -q -E "^OnlyShowIn=" "$i"; then
151 # need to test twice, as lack of the line entirely means we still run it
152 grep -E "^OnlyShowIn=" "$i" |
grep -q 'XFCE;' ||
continue
154 grep -E "^NotShowIn=" "$i" |
grep -q 'XFCE;' && continue
157 trycmd
=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
158 if test "$trycmd"; then
159 which "$trycmd" >/dev
/null
2>&1 ||
continue
162 cmd
=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
163 if test "$cmd" && which "$cmd" >/dev
/null
2>&1; then
172 panel
=`which xfce4-panel`
179 while test $ret -ne 0; do
180 xmessage
-center -file - -timeout 20 -title Error
<<EOF
181 A crash occured in the panel
182 Please report this to the xfce4-dev@xfce.org list
183 or on http://bugs.xfce.org
184 Meanwhile the panel will be restarted
187 A crash occured in the panel
188 Please report this to the xfce4-dev@xfce.org list
189 or on http://bugs.xfce.org
190 Meanwhile the panel will be restarted
198 xsetroot
-bg white
-fg red
-solid black
-cursor_name watch