aboutsummaryrefslogtreecommitdiff
path: root/conf.d/05browser.fish
diff options
context:
space:
mode:
authorDeposite Pirate2025-01-12 14:40:33 +0100
committerDeposite Pirate2025-01-12 14:40:33 +0100
commite7764f9b08072cfb67c2d3ecf075df9a80aee6fd (patch)
tree628d5f66e1d62f1d710bcbe472aa68b5e19522f8 /conf.d/05browser.fish
parent62d7fa8cfa2e6de053d7c1238bd8fdcdf0cc8a7d (diff)
Import config.
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