43 lines
607 B
Bash
43 lines
607 B
Bash
#!/usr/bin/env bash
|
|
|
|
lower=${1,,}
|
|
|
|
echo $lower
|
|
echo "${lower%%:*}"
|
|
|
|
case "${lower%%:*}" in
|
|
*.slack.*)
|
|
exec qutebrowser-comms "$1"
|
|
;;
|
|
file)
|
|
exec nautilus "$1"
|
|
;;
|
|
ssh)
|
|
host=$(echo $1 | cut -d "/" -f 3)
|
|
exec foot ssh "$host"
|
|
;;
|
|
*.html|http|https)
|
|
exec firefox "$1"
|
|
;;
|
|
*.ps|*.eps|*.pdf)
|
|
exec zathura "$1"
|
|
;;
|
|
*.gif|*.mp4)
|
|
exec mpv --loop=inf "$1"
|
|
;;
|
|
*.jpeg|*.jpg|*.png)
|
|
exec imv "$1"
|
|
;;
|
|
atom)
|
|
exec atom "$1"
|
|
;;
|
|
*.tex|*.md|mailto)
|
|
exec em "$1"
|
|
;;
|
|
*)
|
|
notify-send "${0}" "Don't know how to open ${@}" -t 2500 >&2
|
|
exec foot --app-id 'files' ranger $@
|
|
;;
|
|
esac
|
|
|