yosh f317ec831e | ||
---|---|---|
LICENSE | ||
Makefile | ||
README.md | ||
mimeopen | ||
xdg-email | ||
xdg-open |
README.md
Mimix
What is mimix?
mimix is a 99.9% portable rewrite of mimi. I made this because I like rewriting stuff in posix shell.
Changes from mimi
Probably-breaking changes are bolded.
- The script is now in POSIX shell as well as (mostly) conforming to POSIX utility usage.
- The only utility usage not conforming to POSIX is
grep -m -R
, but that is supported by GNU coreutils, NetBSD, OpenBSD, FreeBSD, and busybox utils, so I think all bases are covered there.
- The only utility usage not conforming to POSIX is
- I removed the setting and usage of the
$protocol
variable, rather opting to simply set$mime
tox-scheme-handler/$rematch
if a protocol is matched. All.desktop
files use thex-scheme-handler/
MimeType anyway, and I don't think anyone relied on their config having only the protocol and notx-scheme-handler
. This simply solves conflicts. - mimix does not use
$TERM
for determining your terminal, rather$TERMINAL
.$TERM
is usually reserved forterminfo
databases and such, and 99% of the time isn't executable, so it felt weird to interpret it as an executable.$TERMINAL
, while informal, is generally more used as a variable people use to set an executable terminal, hence why I changed it to use that now. - I removed
$MENUARGS
, since I found it redundant as most menu arguments people will use won't use spaces anyway (except prompt, but the prompt gets set manually, so it is irrelevant). put all your menu args in$MENU
- The .desktop
Exec
line and your mimix.conf will be treated as a shell command, not a program with arguments. This follows the xdg spec and what xdg-open does. It also allows for slightly more flexibility. Take extra care on avoiding word globbing (use quotes if unsure) and escaping special characters, and write as one would in the shell. The argument to mimix will be escaped for you, so no need to worry about that. - Extensions are prefixed with a
.
now. This is to avoid quick-glance ambiguity with general MIMEs.
Installation
- Clone the repository:
git clone https://git.unix.dog/mimix
You now have two options for installing: user-wide or system-wide.
User-wide
- Place
xdg-open
andxdg-email
in a PATH that comes before the system-level$PATH
e.g.$HOME/.local/bin
.
System-wide
- To replace the system's
xdg-open
andxdg-email
, just domake install
as root.
Example configuration
# This is a comment, and also shows setting the TERMINAL variable.
TERMINAL: urxvt
MENU: fzfmenu
# The "End of arguments" signifier is not passed by default, as there might be programs that do not support it.
# These environment variables are unquoted because I know they will never contain spaces. Remember, treat these lines like a shell.
text/: $TERMINAL -e $VISUAL --
audio/: mpv --player-operation-mode=pseudo-gui --
video/: mpv --player-operation-mode=pseudo-gui --
image/: nsxiv-rifle --
# Specific mimetypes are processed before general mimetypes, so these will take priority over the general ones above.
inode/directory: $TERMINAL -e nnn --
image/x-xcf: gimp --
application/pdf: zathura --
application/epub+zip: zathura --
image/vnd.djvu: zathura --
x-scheme-handler/magnet: $TERMINAL -e aria2c --
application/x-bittorrent: $TERMINAL -e aria2c --
# Specific extensions are processed before mimes, so specific extensions can be treated specially
.log: some-special-log-viewer-program --
x-scheme-handler/http: palemoon --
x-scheme-handler/https: palemoon --
x-scheme-handler/chrome: palemoon --
text/html: palemoon --
application/x-extension-htm: palemoon --
application/x-extension-html: palemoon --
application/x-extension-shtml: palemoon --
application/xhtml+xml: palemoon --
application/x-extension-xhtml: palemoon --
application/x-extension-xht: palemoon --
Tips and tricks
- You can set
MENU
in order to use a dmenu alternative. For instance, to userofi
:
MENU: rofi -dmenu