aboutsummaryrefslogtreecommitdiff
path: root/conf.d/05browser.fish
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d/05browser.fish')
-rw-r--r--conf.d/05browser.fish30
1 files changed, 30 insertions, 0 deletions
diff --git a/conf.d/05browser.fish b/conf.d/05browser.fish
new file mode 100644
index 0000000..4266374
--- /dev/null
+++ b/conf.d/05browser.fish
@@ -0,0 +1,30 @@
+if status is-interactive; and not fish_is_root_user
+
+if test -z "$HOMEPAGE"
+ set -x HOMEPAGE "https://html.duckduckgo.com"
+end
+
+# Console browser to look for by order of preference
+set -f browsers 'links' 'w3m' 'elinks' 'lynx'
+
+# Find a suitable console web browser
+set -f found_browser (find_prog $browsers)
+
+if test -n "$found_browser"
+
+ # If $BROWSER is unset, set it
+ if test -z "$BROWSER"
+ set -x BROWSER $found_browser
+ end
+
+ function www --description "Browse the WWW"
+ if test -z $argv
+ $BROWSER $HOMEPAGE
+ return
+ end
+
+ $BROWSER $argv
+ end
+end
+
+end