aboutsummaryrefslogtreecommitdiff
path: root/.config/shell/posix-functions/POSIX_open.sh
diff options
context:
space:
mode:
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
+}