2015-06-23 00:07 UTC
  • Xyne



Open files by MIME-type or file name using regular expressions.

Latest Version:



  • any


  • python2
  • python2-xdg
  • file

Optional Dependencies:

  • MIME-types: for recognizing more MIME-types

Arch Repositories:

  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]



Arch Forum ID:




Mimeo uses MIME-type file associations to determine which application should be used to open a file. It can launch files or print information such as the command that it would use, the detected MIME-type, etc. It is also possible to use regular expressions to associate arguments with applications. The most common example is to open URLs in browsers or associate file extensions with applications irrespective of their MIME-type.

Mimeo tries to adhere to the relevant standards on freedesktop.org and should therefore be compatible with other applications that set or read MIME-type associations, e.g. PCManFM.

Please notify the author of any non-standard behavior so that it can be corrected.

See mimeo --help for options and usage information.

Editing MIME-types

Mimeo is able to update MIME-type associations (add, remove, clear) and configure defaults. It can also update MIME-cache files and check for invalid desktop entries. See "mimeo --help" for more information.


Associate shell scripts with Leafpad.

test is an extensionless Bash script.

# find Leafpad's desktop file
> mimeo --app2desk leafpad
  leafpad.desktop  /usr/share/applications/leafpad.desktop

# determine "test" file's MIME-type
> mimeo -m test

# associate "text/x-shellscript" with Leafpad
> mimeo --add text/x-shellscript leafpad.desktop

Association File Examples

These are just a few quick examples of how to create associations using the associations file. See "mimeo --assoc-help" for more information.

Open URLs with Firefox:

/usr/bin/firefox %U

Open the following files with medit by extension: Perl (.pl), Python (.py), Haskell (.hs)

/usr/bin/medit %F

Open various media files in VLC by extension:

/usr/bin/vlc --one-instance --playlist-enqueue %F

Help Message

$ mimeo --help

usage: mimeo [options] [<arg> ...]

Open files using MIME-type associations.

positional arguments:

  If no operation is specified, the commands determined by "--command" will
  be run, i.e. the passed arguments will be opened.

  -h, --help            Display this help message and exit.
  --assoc-help          Display information about the custom associations
  --mimeman-help        Display information about managing MIME-type
  -c, --command         Print the full command(s) and exit.
  -d, --desktop         Print the associated desktop file names and paths and
  -m, --mimetype        Print the detected MIME-type(s) and exit.
  --app2desk            List desktop files that use the given executables and
  --purge {nothing,hide,delete}
                        Check desktop files and update associations and cache
                        files. The parameter determines the action to take for
                        invalid desktop files. "nothing": Do nothing with the
                        invalid desktop files. "hide": Insert "Hidden=True" in
                        invalid desktop files. "delete": Attempt to delete
                        invalid desktop files. "--system" can be used to
                        restrict the operation to system files when running as
  --update              Update associations and cache files.
  --add <MIME-type matcher> [<desktop.file> ...]
                        Associate MIME-types with desktop files. See
                        "--mimeman-help" for more information.
  --remove <MIME-type matcher> [<desktop.file> ...]
                        Remove associations by adding them to the "Removed
                        Associations" section of mimeapps.list. This can
                        effectively hide system-associations for the user.
                        This does not affect default. Use "--clear" to forget
                        a user-association. See "--mimeman-help" for more
  --clear <MIME-type matcher> [<desktop.file> ...]
                        Clear associations. If no desktop files are specified,
                        all associations for the MIME-type(s) will be cleared.
                        This affects defaults. See "--mimeman-help" for more
  --prefer <MIME-type matcher> <desktop.file>
                        Set a default association. See "--mimeman-help" for
                        more information.
  --unprefer <MIME-type matcher> <desktop.file>
                        Unset a default association. See "--mimeman-help" for
                        more information.
  --create <desktop.file> <Name> <Exec> [<MIME-type matcher> | ""]
                        Create a minimal desktop file. Edit the created file
                        if necessary. If an empty string is passed instead of
                        a MIME-type matcher, the file will not specify any
                        MIME-type associations. See "--mimeman-help" for more

  Various configuration options.

  -a <filepath>, --assoc <filepath>
                        Specify a file that associates regular expressions
                        with custom commands. This can be used for opening
                        URLs, for example. See "--assoc-help" for details.
  --system              Restrict operations to system files. This is mostly
                        useful for updating system desktop files and MIME
                        information as root.
  -q, --quiet           Suppress all output from launched applications.
  --term <cmd>          Terminal command to use when launching applications
                        with desktop files that specify "Terminal=true". If
                        the command contains the substring "%s" then it will
                        be replaced with the command, otherwise the arguments
                        will be appended to the end of the command. Example:
                        "urxvtc -e %s". If "%s" is wrapped in single quotes
                        ('%s') then the command will be quoted.
  --by-content          Bypass the file extension check and determine MIME-
                        type by file content directly using the "file"



  • added "--by-content" option


  • import defaults from defaults.list to mimeapps.list when updating mimeapps.list


  • added "--quiet" option to suppress output when running applications


  • loading of desktop files in subdirectories & further standard-compliance
  • URI handling via "x-scheme-handle/*" MIME-types
  • special handling of 'file' URIs
  • new output format for some operations


Mimeo subsumed Mimeman's functionality, with needed corrections. Mimeman was a dirty kludge created without any knowledge of the standard. Mimeo is now able to manage MIME-type associations and create desktop files.

Mimeo's algorithm for determing associations has also been corrected in several places.

echo xyne.archlinux.ca | sed 's/\./@/'
Blog News
XHTML 1.0 Strict CSS level 3 Atom 1.0