dotfiles/bin/executable_xdg-open

34 lines
421 B
Bash

#!/usr/bin/env bash
lower=${1,,}
echo $lower
case "${lower%%:*}" in
*.slack.*)
exec qutebrowser-comms "$1"
;;
file)
exec nautilus "$1"
;;
*.html|http|https)
exec firefox "$1"
;;
*.pdf)
exec zathura "$1"
;;
*.gif)
exec mpv --loop=inf "$1"
;;
*.jpeg|*.jpg|*.png)
exec feh "$1"
;;
mailto)
exec emacs -nw "$1"
;;
*)
zenity --warning --text "Don't know how to open $@" >&2
;;
esac