summaryrefslogtreecommitdiff
path: root/archive
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-12-07 10:58:54 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-12-07 17:49:22 -0700
commitdabb0f05dbf9f4c775ba6fab11cd4522c172ae30 (patch)
tree98dfac5f9542aded0eefd5cac59d9119da868cce /archive
parent64a3111fdb7956500a1970c004338e9ee254351a (diff)
downloaddotfiles-dabb0f05dbf9f4c775ba6fab11cd4522c172ae30.tar.gz
archive xdg-open wrapper, at least for now
In light of 0375c8aa, I am unsure whether or not we still need this.
Diffstat (limited to 'archive')
-rwxr-xr-xarchive/bin/xdg-open20
1 files changed, 20 insertions, 0 deletions
diff --git a/archive/bin/xdg-open b/archive/bin/xdg-open
new file mode 100755
index 00000000..f6d2ad99
--- /dev/null
+++ b/archive/bin/xdg-open
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Deal with the fact that xdg-open likes to fork bomb under i3. Idea
+# to bypass system xdg-open in this way from here:
+# https://drewdevault.com/2019/12/30/dotfiles.html
+
+case "${1%%:*}" in
+ http|https)
+ exec firefox --new-window "$1"
+ ;;
+ *.pdf|*.PDF)
+ exec evince "$1"
+ ;;
+ *.xlsx)
+ exec soffice "$1"
+ ;;
+ *)
+ exec /usr/bin/xdg-open "$@"
+ ;;
+esac