Chromium Code Reviews| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 exit_success | 314 exit_success |
| 315 } | 315 } |
| 316 | 316 |
| 317 set_browser_gnome() | 317 set_browser_gnome() |
| 318 { | 318 { |
| 319 binary="`desktop_file_to_binary "$1"`" | 319 binary="`desktop_file_to_binary "$1"`" |
| 320 [ "$binary" ] || exit_failure_file_missing | 320 [ "$binary" ] || exit_failure_file_missing |
| 321 set_browser_mime "$1" || return | 321 set_browser_mime "$1" || return |
| 322 | 322 |
| 323 # Set the default browser. | 323 # Set the default browser. |
| 324 gconftool-2 --type string --set /desktop/gnome/applications/browser/exec "$b inary" | 324 gconftool-2 --type string --set /desktop/gnome/applications/browser/exec "$b inary" |
|
Evan Stade
2009/10/14 19:04:37
why no %U here?
Lei Zhang
2009/10/14 19:42:38
Because it's %s on Gnome. I'll change kde to use %
Evan Stade
2009/10/14 19:50:41
well, you didn't put %s either
Lei Zhang
2009/10/14 20:24:22
It doesn't do that either if you set a browser as
Mike Mammarella
2009/10/15 02:13:48
Yeah, when you have a URL to open it should only l
| |
| 325 gconftool-2 --type bool --set /desktop/gnome/applications/browser/needs_term false | 325 gconftool-2 --type bool --set /desktop/gnome/applications/browser/needs_term false |
| 326 gconftool-2 --type bool --set /desktop/gnome/applications/browser/nremote tr ue | 326 gconftool-2 --type bool --set /desktop/gnome/applications/browser/nremote tr ue |
| 327 # Set the handler for HTTP and HTTPS. | 327 # Set the handler for HTTP and HTTPS. |
| 328 for protocol in http https; do | 328 for protocol in http https; do |
| 329 gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/co mmand "$binary" | 329 gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/co mmand "$binary %s" |
| 330 gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/need s_terminal false | 330 gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/need s_terminal false |
| 331 gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/enab led true | 331 gconftool-2 --type bool --set /desktop/gnome/url-handlers/$protocol/enab led true |
| 332 done | 332 done |
| 333 # Set the handler for about: and unknown URL types. | 333 # Set the handler for about: and unknown URL types. |
| 334 for protocol in about unknown; do | 334 for protocol in about unknown; do |
| 335 gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/co mmand "$binary" | 335 gconftool-2 --type string --set /desktop/gnome/url-handlers/$protocol/co mmand "$binary %s" |
| 336 done | 336 done |
| 337 } | 337 } |
| 338 | 338 |
| 339 # }}} GNOME | 339 # }}} GNOME |
| 340 # {{{ xfce | 340 # {{{ xfce |
| 341 | 341 |
| 342 get_browser_xfce() | 342 get_browser_xfce() |
| 343 { | 343 { |
| 344 search="${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}" | 344 search="${XDG_CONFIG_HOME:-$HOME/.config}:${XDG_CONFIG_DIRS:-/etc/xdg}" |
| 345 IFS=: | 345 IFS=: |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 551 ;; | 551 ;; |
| 552 | 552 |
| 553 generic) | 553 generic) |
| 554 dispatch_generic "$@" | 554 dispatch_generic "$@" |
| 555 ;; | 555 ;; |
| 556 | 556 |
| 557 *) | 557 *) |
| 558 exit_failure_operation_impossible "unknown desktop environment" | 558 exit_failure_operation_impossible "unknown desktop environment" |
| 559 ;; | 559 ;; |
| 560 esac | 560 esac |
| OLD | NEW |