You are not logged in.

#1 2020-11-03 00:08:55

From: Croatia
Registered: 2008-09-14
Posts: 903

mimejs - a replacement for xdg-open written in Node.js


I wrote a tool to make my life easier with xdg-open, so I thought I might as well turn it into a package. It's more of a convenience tool, it's not meant to follow any kind of XDG standard.

It's only 100 lines of code, so it's hackable enough.


To quote the README:

mimejs is a small Node.js application designed to replace xdg-open on a Linux system. It discards any use of *.desktop files and instead focuses on running commands to open files.

Basically, it's a xdg-open replacement with support for:

  • Extensions

  • MIME types

  • Protocols (URLs)

The reason I supported extensions is because almost all files outside Linux have them, and I find them useful. Configured extensions have a priority over MIME types. The MIME types detection is done by the 'file' command. Wildcard matching for MIME types and subtypes is supported.

mimejs uses a simple JSON file for configuration (/etc/mime.json or $HOME/.mime.json). You can basically write any command to open any extension, MIME type or URL.

Check the README for more details.

Any feedback is appreciated.


Last edited by karabaja4 (2020-11-03 09:36:11)


Board footer

Powered by FluxBB