d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
619 stars 43 forks source link

Custom mime types #63

Closed Bellavene closed 2 years ago

Bellavene commented 2 years ago

Would be awesome to be able to set custom scripts for files handling, like in "tg" for example.

# media
video/*; mpv "%s"
audio/ogg; mpv --speed=1.33 "%s"
audio/mpeg; mpv --no-video "%s"
image/*; qview "%s"

# text
text/html; w3m "%s"
text/html; open -a Firefox "%s"
text/plain; less "%s"

# fallback to vim
text/*; vim "%s"

Or at least a custom command to handle file previews. I want to set quicklook for that.

d99kris commented 2 years ago

Perhaps we can start with just adding support for custom command when opening files, as it should be fairly quick. If using command see (Linux) I believe mailcap directives would be used.

Bellavene commented 2 years ago

Custom command will do the job for me.

d99kris commented 2 years ago

Support for custom command has been added in above commit. It's configurable using attachment_open_command - check the README.md for details and example.