-
-
Save ar4s-eth/f0604c6c9cf4e6fd183c5079e5c5c5eb to your computer and use it in GitHub Desktop.
XDG Alternative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Launches files based on their mimetypes | |
# Usage: launch [FILE...] | |
# Dependencies: file | |
case $(file --mime-type "$@" -bL) in | |
# Check for the mimetype of your file (This is POSIX regex) | |
video/* | audio/* | image/gif) | |
# Launch using your favorite application | |
devour mpv "$@" | |
;; | |
# So on and so forth... | |
application/pdf | application/postscript) | |
devour zathura "$@" | |
;; | |
*) exit 1 ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment