~ubuntu-branches/ubuntu/vivid/xfce4-session/vivid-proposed

« back to all changes in this revision

Viewing changes to .pc/xubuntu_set-xdg-current-desktop.patch/scripts/xinitrc.in

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-05-18 20:21:52 UTC
  • mfrom: (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20120518202152-7bm9pla0j3ccfsnk
Tags: 4.10.0-1ubuntu1
* Merge from Debian experimental, remaining Ubuntu changes:
  - debian/control: build-depends on libgnome-keyring-dev to enable GNOME
    Keyring services support.
  - debian/rules: pass --enable-libgnome-keyring to dh_auto_configure.
  - debian/patches:
    + xubuntu_ignore-gdm-lang.patch: do not set $LANG to $GDM_LANG, there's
      already an xsession script to do that, and $GDM_LANG might not contain
      a valid locale code.

* debian/patches:
  - xubuntu_set-xdg-current-desktop.patch: added. Taken from xfce4-utils,
    export XDG_CURRENT_DESKTOP=XFCE, can be useful with alacarte and
    gnome-menus. lp #927172

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# fix broken $UID on some system...
 
4
if test "x$UID" = "x"; then
 
5
  if test -x /usr/xpg4/bin/id; then
 
6
    UID=`/usr/xpg4/bin/id -u`;
 
7
  else
 
8
    UID=`id -u`;
 
9
  fi
 
10
fi
 
11
 
 
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
 
17
fi
 
18
 
 
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
 
23
fi
 
24
 
 
25
# $XDG_CONFIG_HOME defines the base directory relative to which user specific
 
26
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set
 
27
# or empty, a default equal to $HOME/.config should be used.
 
28
if test "x$XDG_CONFIG_HOME" = "x" ; then
 
29
  XDG_CONFIG_HOME=$HOME/.config
 
30
fi
 
31
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"
 
32
 
 
33
# $XDG_CACHE_HOME defines the base directory relative to which user specific
 
34
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not
 
35
# set or empty, a default equal to $HOME/.cache should be used.
 
36
if test "x$XDG_CACHE_HOME" = "x" ; then
 
37
  XDG_CACHE_HOME=$HOME/.cache
 
38
fi
 
39
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"
 
40
 
 
41
# set up XDG user directores.  see
 
42
# http://freedesktop.org/wiki/Software/xdg-user-dirs
 
43
if which xdg-user-dirs-update >/dev/null 2>&1; then
 
44
    xdg-user-dirs-update
 
45
fi
 
46
 
 
47
# Modify libglade and glade environment variables so that
 
48
# it will find the files installed by Xfce
 
49
GLADE_CATALOG_PATH="$GLADE_CATALOG_PATH:/usr/share/glade3/catalogs"
 
50
GLADE_PIXMAP_PATH="$GLADE_PIXMAP_PATH:/usr/lib/glade3/modules"
 
51
GLADE_MODULE_PATH="$GLADE_MODULE_PATH:/usr/share/glade3/pixmaps"
 
52
export GLADE_CATALOG_PATH
 
53
export GLADE_PIXMAP_PATH
 
54
export GLADE_MODULE_PATH
 
55
 
 
56
# For now, start with an empty list
 
57
XRESOURCES=""
 
58
 
 
59
# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
 
60
test -r "@_sysconfdir_@/xdg/xfce4/Xft.xrdb" && XRESOURCES="$XRESOURCES @_sysconfdir_@/xdg/xfce4/Xft.xrdb"
 
61
test -r $HOME/.Xdefaults && XRESOURCES="$XRESOURCES $HOME/.Xdefaults"
 
62
 
 
63
BASEDIR=$XDG_CONFIG_HOME/xfce4
 
64
if test -r "$BASEDIR/Xft.xrdb"; then
 
65
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
 
66
elif test -r "$XFCE4HOME/Xft.xrdb"; then
 
67
  mkdir -p "$BASEDIR"
 
68
  cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
 
69
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
 
70
fi
 
71
 
 
72
# merge in X cursor settings
 
73
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"
 
74
 
 
75
# ~/.Xresources contains overrides to the above
 
76
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"
 
77
 
 
78
# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
 
79
cat /dev/null $XRESOURCES | xrdb -nocpp -merge -
 
80
 
 
81
# load local modmap
 
82
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
 
83
 
 
84
# run xfce4-session if installed
 
85
if which xfce4-session >/dev/null 2>&1; then
 
86
 
 
87
  # check if we start xfce4-session with ck-launch-session. this is only
 
88
  # required for starting from a console, not a login manager
 
89
  if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
 
90
    if which ck-launch-session >/dev/null 2>&1; then
 
91
      ck-launch-session xfce4-session
 
92
    else
 
93
      echo
 
94
      echo "You have tried to start Xfce with consolekit support, but"
 
95
      echo "ck-launch-session is not installed."
 
96
      echo "Aborted startup..."
 
97
      echo
 
98
 
 
99
      exit 1
 
100
    fi
 
101
  else
 
102
    # start xfce4-session normally
 
103
    xfce4-session
 
104
  fi
 
105
 
 
106
  exit 0
 
107
fi
 
108
 
 
109
##################
 
110
# IMPORTANT NOTE #
 
111
##################
 
112
 
 
113
# Everything below here ONLY gets executed if you are NOT using xfce4-session
 
114
# (Xfce's session manager).  If you are using the session manager, everything
 
115
# below is handled by it, and the code below is not executed at all.  If you're
 
116
# not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
 
117
# in a terminal while Xfce is running.
 
118
 
 
119
##################
 
120
 
 
121
# Use dbus-launch if installed.
 
122
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
 
123
  if which dbus-launch >/dev/null 2>&1; then
 
124
    eval `dbus-launch --sh-syntax --exit-with-session`
 
125
    # some older versions of dbus don't export the var properly
 
126
    export DBUS_SESSION_BUS_ADDRESS
 
127
  else
 
128
    echo "Could not find dbus-launch; Xfce will not work properly" >&2
 
129
    fi
 
130
fi
 
131
 
 
132
# this is only necessary when running w/o xfce4-session
 
133
xsetroot -solid black -cursor_name watch
 
134
 
 
135
# or use old-fashioned startup script otherwise
 
136
 
 
137
xfsettingsd &
 
138
xfwm4 --daemon
 
139
 
 
140
# start up stuff in $XDG_CONFIG_HOME/autostart/
 
141
if test -d "$XDG_CONFIG_HOME/autostart"; then
 
142
  for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
 
143
    grep -q -E "^Hidden=true" "$i" && continue
 
144
    if grep -q -E "^OnlyShowIn=" "$i"; then
 
145
      # need to test twice, as lack of the line entirely means we still run it
 
146
      grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
 
147
    fi
 
148
    grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue
 
149
 
 
150
    # check for TryExec
 
151
    trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
 
152
    if test "$trycmd"; then
 
153
      which "$trycmd" >/dev/null 2>&1 || continue
 
154
    fi
 
155
 
 
156
    cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
 
157
    if test "$cmd" && which "$cmd" >/dev/null 2>&1; then
 
158
      $cmd &
 
159
    fi
 
160
  done
 
161
fi
 
162
 
 
163
xfdesktop&
 
164
orage &
 
165
 
 
166
panel=`which xfce4-panel`
 
167
case "x$panel" in
 
168
        x|xno*)
 
169
                ;;
 
170
        *)
 
171
                $panel
 
172
                ret=$?
 
173
                while test $ret -ne 0; do
 
174
                        xmessage -center -file - -timeout 20 -title Error <<EOF
 
175
A crash occured in the panel
 
176
Please report this to the xfce4-dev@xfce.org list
 
177
or on http://bugs.xfce.org
 
178
Meanwhile the panel will be restarted
 
179
EOF
 
180
                        cat >&2 <<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
 
185
EOF
 
186
                        $panel
 
187
                        ret=$?
 
188
                done
 
189
                ;;
 
190
esac
 
191
 
 
192
xsetroot -bg white -fg red  -solid black -cursor_name watch