| OLD | NEW |
| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 case "$(uname 2>/dev/null)" in | 216 case "$(uname 2>/dev/null)" in |
| 217 Darwin) | 217 Darwin) |
| 218 DE=darwin; | 218 DE=darwin; |
| 219 ;; | 219 ;; |
| 220 esac | 220 esac |
| 221 fi | 221 fi |
| 222 | 222 |
| 223 if [ x"$DE" = x"gnome" ]; then | 223 if [ x"$DE" = x"gnome" ]; then |
| 224 # gnome-default-applications-properties is only available in GNOME 2.x | 224 # gnome-default-applications-properties is only available in GNOME 2.x |
| 225 # but not in GNOME 3.x | 225 # but not in GNOME 3.x |
| 226 which gnome-default-applications-properties 2> /dev/null || DE="gnome3" | 226 which gnome-default-applications-properties > /dev/null 2> /dev/null || DE
="gnome3" |
| 227 fi | 227 fi |
| 228 } | 228 } |
| 229 | 229 |
| 230 #---------------------------------------------------------------------------- | 230 #---------------------------------------------------------------------------- |
| 231 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 | 231 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 |
| 232 # It also always returns 1 in KDE 3.4 and earlier | 232 # It also always returns 1 in KDE 3.4 and earlier |
| 233 # Simply return 0 in such case | 233 # Simply return 0 in such case |
| 234 | 234 |
| 235 kfmclient_fix_exit_code() | 235 kfmclient_fix_exit_code() |
| 236 { | 236 { |
| 237 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0; | 237 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0; |
| 238 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` | 238 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` |
| 239 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` | 239 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` |
| 240 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` | 240 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` |
| 241 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` | 241 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` |
| 242 test "$major" -gt 3 && return $1 | 242 test "$major" -gt 3 && return $1 |
| 243 test "$minor" -gt 5 && return $1 | 243 test "$minor" -gt 5 && return $1 |
| 244 test "$release" -gt 4 && return $1 | 244 test "$release" -gt 4 && return $1 |
| 245 return 0 | 245 return 0 |
| 246 } | 246 } |
| OLD | NEW |