summaryrefslogtreecommitdiff
path: root/bin/xdg-open
blob: f6d2ad99ea5890162c1701e992c5d73452581634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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