| OLD | NEW |
| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 *) | 206 *) |
| 207 echo "$browser" | 207 echo "$browser" |
| 208 ;; | 208 ;; |
| 209 esac | 209 esac |
| 210 } | 210 } |
| 211 | 211 |
| 212 # Reads the KDE browser setting, compensating for a bug in some versions of krea
dconfig. | 212 # Reads the KDE browser setting, compensating for a bug in some versions of krea
dconfig. |
| 213 read_kde_browser() | 213 read_kde_browser() |
| 214 { | 214 { |
| 215 browser="`kreadconfig --file kdeglobals --group General --key BrowserApplica
tion`" | 215 browser="`kreadconfig --file kdeglobals --group General --key BrowserApplica
tion`" |
| 216 if [ "$browser" ]; then | 216 if [ x"$browser" != x ]; then |
| 217 echo "$browser" | 217 echo "$browser" |
| 218 else |
| 219 # kreadconfig in KDE 4 may not notice Key[$*]=... localized settings, so |
| 220 # check by hand if it didn't find anything (oddly kwriteconfig works |
| 221 # fine though). |
| 222 kdeglobals_dir=`kde${KDE_SESSION_VERSION}-config --path config | cut -d
':' -f 1` |
| 223 kdeglobals="$kdeglobals_dir/kdeglobals" |
| 224 [ ! -f "$kdeglobals" ] && return |
| 225 # This will only take the first value if there is more than one. |
| 226 grep '^BrowserApplication\[$[^]=]*\]=' "$kdeglobals" | head -n 1 | cut -
d= -f 2- |
| 218 fi | 227 fi |
| 219 # kreadconfig in KDE 4 may not notice Key[$*]=... localized settings, so che
ck | |
| 220 # by hand if it didn't find anything (oddly kwriteconfig works fine though). | |
| 221 kdeglobals_dir=`kde${KDE_SESSION_VERSION}-config --path config | cut -d ':'
-f 1` | |
| 222 kdeglobals="$kdeglobals_dir/kdeglobals" | |
| 223 [ ! -f "$kdeglobals" ] && return | |
| 224 # This will only take the first value if there is more than one. | |
| 225 grep '^BrowserApplication\[$[^]=]*\]=' "$kdeglobals" | head -n 1 | cut -d= -
f 2- | |
| 226 } | 228 } |
| 227 | 229 |
| 228 get_browser_kde() | 230 get_browser_kde() |
| 229 { | 231 { |
| 230 browser="`read_kde_browser`" | 232 browser="`read_kde_browser`" |
| 231 if [ x"$browser" = x ]; then | 233 if [ x"$browser" = x ]; then |
| 232 # No explicit default browser; KDE will use the MIME type text/html. | 234 # No explicit default browser; KDE will use the MIME type text/html. |
| 233 get_browser_mime | 235 get_browser_mime |
| 234 else | 236 else |
| 235 resolve_kde_browser_desktop | 237 resolve_kde_browser_desktop |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 ;; | 554 ;; |
| 553 | 555 |
| 554 generic) | 556 generic) |
| 555 dispatch_generic "$@" | 557 dispatch_generic "$@" |
| 556 ;; | 558 ;; |
| 557 | 559 |
| 558 *) | 560 *) |
| 559 exit_failure_operation_impossible "unknown desktop environment" | 561 exit_failure_operation_impossible "unknown desktop environment" |
| 560 ;; | 562 ;; |
| 561 esac | 563 esac |
| OLD | NEW |