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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 [ "$browser" ]; then |
217 echo "$browser" | 217 echo "$browser" |
218 fi | 218 fi |
219 # kreadconfig in KDE 4 may not notice Key[$*]=... localized settings, so che
ck | 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). | 220 # by hand if it didn't find anything (oddly kwriteconfig works fine though). |
221 kdeglobals="${KDE_HOME:-$HOME/.kde}/share/config/kdeglobals" | 221 kdeglobals_dir=`kde${KDE_SESSION_VERSION}-config --path config | cut -d ':'
-f 1` |
| 222 kdeglobals="$kdeglobals_dir/kdeglobals" |
222 [ ! -f "$kdeglobals" ] && return | 223 [ ! -f "$kdeglobals" ] && return |
223 # This will only take the first value if there is more than one. | 224 # This will only take the first value if there is more than one. |
224 grep '^BrowserApplication\[$[^]=]*\]=' "$kdeglobals" | head -n 1 | cut -d= -
f 2- | 225 grep '^BrowserApplication\[$[^]=]*\]=' "$kdeglobals" | head -n 1 | cut -d= -
f 2- |
225 } | 226 } |
226 | 227 |
227 get_browser_kde() | 228 get_browser_kde() |
228 { | 229 { |
229 browser="`read_kde_browser`" | 230 browser="`read_kde_browser`" |
230 if [ x"$browser" = x ]; then | 231 if [ x"$browser" = x ]; then |
231 # No explicit default browser; KDE will use the MIME type text/html. | 232 # No explicit default browser; KDE will use the MIME type text/html. |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 ;; | 552 ;; |
552 | 553 |
553 generic) | 554 generic) |
554 dispatch_generic "$@" | 555 dispatch_generic "$@" |
555 ;; | 556 ;; |
556 | 557 |
557 *) | 558 *) |
558 exit_failure_operation_impossible "unknown desktop environment" | 559 exit_failure_operation_impossible "unknown desktop environment" |
559 ;; | 560 ;; |
560 esac | 561 esac |
OLD | NEW |