Last active
January 20, 2022 18:47
-
-
Save michaelskyba/a00ebfa607cb72b9d6ba3bdc70b21088 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# a case statement works way better than the terrible xdg-open | |
# usage: msk_open <file> | |
# Get the raw filetype | |
type=$(file -i "$1") | |
# Parse file -i | |
type=${type#*: } | |
type=${type%;*} | |
# Pick the command | |
case "$type" in | |
#application/pdf) zathura "$1" ;; | |
*) echo "No configuration for type '$type'." ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment