diff options
Diffstat (limited to 'archive')
-rwxr-xr-x | archive/bin/xdg-open | 20 |
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 |