Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: scripts/xdg-utils-common.in

Issue 7453013: Bring xdg-utils up to date with upstream repository. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/xdg-utils/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/xdg-settings ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 #---------------------------------------------------------------------------- 2 #----------------------------------------------------------------------------
3 # Common utility functions included in all XDG wrapper scripts 3 # Common utility functions included in all XDG wrapper scripts
4 #---------------------------------------------------------------------------- 4 #----------------------------------------------------------------------------
5 5
6 DEBUG() 6 DEBUG()
7 { 7 {
8 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; 8 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0;
9 [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; 9 [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0;
10 shift 10 shift
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 #-------------------------------------- 248 #--------------------------------------
249 # Checks for known desktop environments 249 # Checks for known desktop environments
250 # set variable DE to the desktop environments name, lowercase 250 # set variable DE to the desktop environments name, lowercase
251 251
252 detectDE() 252 detectDE()
253 { 253 {
254 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 254 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
255 unset GREP_OPTIONS 255 unset GREP_OPTIONS
256 256
257 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; 257 if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
258 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; 258 case "${XDG_CURRENT_DESKTOP}" in
259 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/D Bus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/nul l 2>&1` ; then DE=gnome; 259 GNOME)
260 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce; 260 DE=gnome;
261 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2> &1; then DE=xfce 261 ;;
262 KDE)
263 DE=kde;
264 ;;
265 LXDE)
266 DE=lxde;
267 ;;
268 XFCE)
269 DE=xfce
270 esac
271 fi
272
273 if [ x"$DE" = x"" ]; then
274 # classic fallbacks
275 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
276 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
277 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop /DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/n ull 2>&1` ; then DE=gnome;
278 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/n ull 2>&1; then DE=xfce;
279 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
280 fi
262 fi 281 fi
263 282
264 if [ x"$DE" = x"" ]; then 283 if [ x"$DE" = x"" ]; then
265 # fallback to checking $DESKTOP_SESSION 284 # fallback to checking $DESKTOP_SESSION
266 case "$DESKTOP_SESSION" in 285 case "$DESKTOP_SESSION" in
267 gnome) 286 gnome)
268 DE=gnome; 287 DE=gnome;
269 ;; 288 ;;
270 LXDE) 289 LXDE)
271 DE=lxde; 290 DE=lxde;
(...skipping 29 matching lines...) Expand all
301 { 320 {
302 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` 321 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
303 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` 322 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
304 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` 323 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
305 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` 324 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
306 test "$major" -gt 3 && return $1 325 test "$major" -gt 3 && return $1
307 test "$minor" -gt 5 && return $1 326 test "$minor" -gt 5 && return $1
308 test "$release" -gt 4 && return $1 327 test "$release" -gt 4 && return $1
309 return 0 328 return 0
310 } 329 }
OLDNEW
« no previous file with comments | « scripts/xdg-settings ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698