diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-04-24 13:59:20 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2012-04-24 13:59:20 +0200 |
commit | e2c74cba0311d2ac689ac8ddc149bc1396000758 (patch) | |
tree | f66b61f6916a716f970a9ca4ae10eb5feb8b83b0 /bashrc/common | |
parent | f229f41e752586f21d2bfd2fa51bc6d57c4fbaff (diff) | |
download | dotfiles-e2c74cba0311d2ac689ac8ddc149bc1396000758.tar.gz dotfiles-e2c74cba0311d2ac689ac8ddc149bc1396000758.tar.xz dotfiles-e2c74cba0311d2ac689ac8ddc149bc1396000758.zip |
bashrc/common/browser: refactor script to make it more flexible
Diffstat (limited to 'bashrc/common')
-rw-r--r-- | bashrc/common/browser.sh | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/bashrc/common/browser.sh b/bashrc/common/browser.sh index 1f610f0..7dc6bd2 100644 --- a/bashrc/common/browser.sh +++ b/bashrc/common/browser.sh @@ -1,13 +1,12 @@ # browser options -# but user opera, if available -if hash opera > /dev/null 2>&1 ; then - export BROWSER=opera -else - - # use firefox by default ... - if hash firefox > /dev/null 2>&1 ; then - export BROWSER=firefox - fi -fi +# check in this order for existence and use the first available +browser="x-www-browser opera chromium google-chrome firefox" + +for b in $browser ; do + if hash $b > /dev/null 2>&1 ; then + export BROWSER=$b + break + fi +done |