Skip to content

Commit 6ca0f80

Browse files
ruedigergitster
authored andcommitted
web--browse: Add support for xdg-open
xdg-open is a tool similar to git-web--browse. It opens a file or URL in the user's preferred application. It could probably be made default at least on Linux with a graphical environment. Signed-off-by: Rüdiger Sonderfeld <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 12dd2f6 commit 6ca0f80

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Documentation/git-web--browse.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The following browsers (or commands) are currently supported:
3535
* open (this is the default under Mac OS X GUI)
3636
* start (this is the default under MinGW)
3737
* cygstart (this is the default under Cygwin)
38+
* xdg-open
3839

3940
Custom commands may also be specified.
4041

git-web--browse.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ valid_tool() {
3434
firefox | iceweasel | seamonkey | iceape | \
3535
chrome | google-chrome | chromium | chromium-browser | \
3636
konqueror | opera | w3m | elinks | links | lynx | dillo | open | \
37-
start | cygstart)
37+
start | cygstart | xdg-open)
3838
;; # happy
3939
*)
4040
valid_custom_tool "$1" || return 1
@@ -112,7 +112,7 @@ fi
112112

113113
if test -z "$browser" ; then
114114
if test -n "$DISPLAY"; then
115-
browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo"
115+
browser_candidates="firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo xdg-open"
116116
if test "$KDE_FULL_SESSION" = "true"; then
117117
browser_candidates="konqueror $browser_candidates"
118118
fi
@@ -179,7 +179,7 @@ konqueror)
179179
;;
180180
esac
181181
;;
182-
w3m|elinks|links|lynx|open|cygstart)
182+
w3m|elinks|links|lynx|open|cygstart|xdg-open)
183183
"$browser_path" "$@"
184184
;;
185185
start)

0 commit comments

Comments
 (0)