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

Side by Side Diff: third_party/xdg-utils/scripts/xdg-settings

Issue 6737007: Update xdg-utils to the latest version available in git. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 9 years, 8 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
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 #--------------------------------------------- 2 #---------------------------------------------
3 # xdg-settings 3 # xdg-settings
4 # 4 #
5 # Utility script to get various settings from the desktop environment. 5 # Utility script to get various settings from the desktop environment.
6 # 6 #
7 # Refer to the usage() function below for usage. 7 # Refer to the usage() function below for usage.
8 # 8 #
9 # Copyright 2009, Google Inc. 9 # Copyright 2009, Google Inc.
10 # 10 #
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 echo "Use 'man xdg-settings' or 'xdg-settings --manual' for addition al info." 280 echo "Use 'man xdg-settings' or 'xdg-settings --manual' for addition al info."
281 exit_success 281 exit_success
282 ;; 282 ;;
283 283
284 --manual) 284 --manual)
285 manualpage 285 manualpage
286 exit_success 286 exit_success
287 ;; 287 ;;
288 288
289 --version) 289 --version)
290 echo "xdg-settings 1.0.2" 290 echo "xdg-settings 1.1.0 rc1"
291 exit_success 291 exit_success
292 ;; 292 ;;
293 esac 293 esac
294 done 294 done
295 } 295 }
296 296
297 check_common_commands "$@" 297 check_common_commands "$@"
298 298
299 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; 299 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL;
300 if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then 300 if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then
301 # Be silent 301 # Be silent
302 xdg_redirect_output=" > /dev/null 2> /dev/null" 302 xdg_redirect_output=" > /dev/null 2> /dev/null"
303 else 303 else
304 # All output to stderr 304 # All output to stderr
305 xdg_redirect_output=" >&2" 305 xdg_redirect_output=" >&2"
306 fi 306 fi
307 307
308 #-------------------------------------- 308 #--------------------------------------
309 # Checks for known desktop environments 309 # Checks for known desktop environments
310 # set variable DE to the desktop environments name, lowercase 310 # set variable DE to the desktop environments name, lowercase
311 311
312 detectDE() 312 detectDE()
313 { 313 {
314 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; 314 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
315 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; 315 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
316 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; 316 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;
317 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce; 317 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce;
318 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
319 else DE=""
318 fi 320 fi
319 } 321 }
320 322
321 #---------------------------------------------------------------------------- 323 #----------------------------------------------------------------------------
322 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 324 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
323 # It also always returns 1 in KDE 3.4 and earlier 325 # It also always returns 1 in KDE 3.4 and earlier
324 # Simply return 0 in such case 326 # Simply return 0 in such case
325 327
326 kfmclient_fix_exit_code() 328 kfmclient_fix_exit_code()
327 { 329 {
328 version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep KDE` 330 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0;
329 major=`echo $version | sed 's/KDE: \([0-9]\).*/\1/'` 331 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
330 minor=`echo $version | sed 's/KDE: [0-9]*\.\([0-9]\).*/\1/'` 332 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
331 release=`echo $version | sed 's/KDE: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` 333 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
334 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
332 test "$major" -gt 3 && return $1 335 test "$major" -gt 3 && return $1
333 test "$minor" -gt 5 && return $1 336 test "$minor" -gt 5 && return $1
334 test "$release" -gt 4 && return $1 337 test "$release" -gt 4 && return $1
335 return 0 338 return 0
336 } 339 }
337 340
338 check_desktop_filename() 341 check_desktop_filename()
339 { 342 {
340 case "$1" in 343 case "$1" in
341 */*) 344 */*)
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 ;; 866 ;;
864 867
865 generic) 868 generic)
866 dispatch_generic "$@" 869 dispatch_generic "$@"
867 ;; 870 ;;
868 871
869 *) 872 *)
870 exit_failure_operation_impossible "unknown desktop environment" 873 exit_failure_operation_impossible "unknown desktop environment"
871 ;; 874 ;;
872 esac 875 esac
OLDNEW
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-screensaver.in ('k') | third_party/xdg-utils/scripts/xdg-settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698