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

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

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
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-terminal.in ('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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 echo "Use 'man @NAME@' or '@NAME@ --manual' for additional info." 162 echo "Use 'man @NAME@' or '@NAME@ --manual' for additional info."
163 exit_success 163 exit_success
164 ;; 164 ;;
165 165
166 --manual) 166 --manual)
167 manualpage 167 manualpage
168 exit_success 168 exit_success
169 ;; 169 ;;
170 170
171 --version) 171 --version)
172 echo "@NAME@ 1.0.2" 172 echo "@NAME@ 1.1.0 rc1"
173 exit_success 173 exit_success
174 ;; 174 ;;
175 esac 175 esac
176 done 176 done
177 } 177 }
178 178
179 check_common_commands "$@" 179 check_common_commands "$@"
180 180
181 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; 181 [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL;
182 if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then 182 if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then
183 # Be silent 183 # Be silent
184 xdg_redirect_output=" > /dev/null 2> /dev/null" 184 xdg_redirect_output=" > /dev/null 2> /dev/null"
185 else 185 else
186 # All output to stderr 186 # All output to stderr
187 xdg_redirect_output=" >&2" 187 xdg_redirect_output=" >&2"
188 fi 188 fi
189 189
190 #-------------------------------------- 190 #--------------------------------------
191 # Checks for known desktop environments 191 # Checks for known desktop environments
192 # set variable DE to the desktop environments name, lowercase 192 # set variable DE to the desktop environments name, lowercase
193 193
194 detectDE() 194 detectDE()
195 { 195 {
196 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; 196 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
197 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; 197 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
198 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; 198 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;
199 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce; 199 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce;
200 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; 200 fi
201
202 if [ x"$DE" = x"" ]; then
203 # if all else fails, fallback to checking $DESKTOP_SESSION
204 case "$DESKTOP_SESSION" in
205 LXDE)
206 DE=lxde;
207 ;;
208 xfce|xfce4)
209 DE=xfce;
210 ;;
211 esac
212 fi
213
214 if [ x"$DE" = x"gnome" ]; then
215 # gnome-default-applications-properties is only available in GNOME 2.x
216 # but not in GNOME 3.x
217 which gnome-default-applications-properties 2> /dev/null || DE="gnome3"
201 fi 218 fi
202 } 219 }
203 220
204 #---------------------------------------------------------------------------- 221 #----------------------------------------------------------------------------
205 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 222 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
206 # It also always returns 1 in KDE 3.4 and earlier 223 # It also always returns 1 in KDE 3.4 and earlier
207 # Simply return 0 in such case 224 # Simply return 0 in such case
208 225
209 kfmclient_fix_exit_code() 226 kfmclient_fix_exit_code()
210 { 227 {
211 version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE '` 228 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0;
229 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
212 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` 230 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
213 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` 231 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
214 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` 232 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
215 test "$major" -gt 3 && return $1 233 test "$major" -gt 3 && return $1
216 test "$minor" -gt 5 && return $1 234 test "$minor" -gt 5 && return $1
217 test "$release" -gt 4 && return $1 235 test "$release" -gt 4 && return $1
218 return 0 236 return 0
219 } 237 }
OLDNEW
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-terminal.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698