aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/posix-functions/POSIX_open.sh
diff options
context:
space:
mode:
authorkj-sh6042024-07-17 22:27:14 -0400
committerkj-sh6042024-07-17 22:27:14 -0400
commitfe0f355277b220f304b2e58695349add20741e91 (patch)
treef140ce64ac2bc7bf124a74bf81ca0bdb6c4446ee /.config/shell/posix-functions/POSIX_open.sh
parent311ea8ad7c5049ac9efec309b35073b19638054b (diff)
feat: new POSIX and fish functions
Diffstat (limited to '.config/shell/posix-functions/POSIX_open.sh')
-rw-r--r--.config/shell/posix-functions/POSIX_open.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/.config/shell/posix-functions/POSIX_open.sh b/.config/shell/posix-functions/POSIX_open.sh
new file mode 100644
index 0000000..b53e93f
--- /dev/null
+++ b/.config/shell/posix-functions/POSIX_open.sh
@@ -0,0 +1,6 @@
+open() {
+ command -v xdg-open > /dev/null && xdg-open "$@" && return
+ [ "$(uname)" = "Darwin" ] && open "$@" && return
+ [ "$(uname)" = "Haiku" ] && open "$@" && return
+ echo "error: could not detect the open command for your system." && return 1
+}