REBASE(1) REBASE(1) NAME mimeman - a mimetype to application association manager SYNOPSIS mimeman [options] DESCRIPTION Mimeman is a tool for managing the way applications are associated with files based on their mimetypes. It can automatically update mime‐ type.cache and defaults.list in ~/.local/share/applications to add or remove associations. It can also create custom desktop files in the same directory for applications which lack their own. Mimeman is capable of using regular expressions to edit multiple file associations at once. The regular expressions are matched against mime‐ types drawn from /etc/mime.types and ~/.mime.types. SPECIFYING MIMETYPES Mimetype arguments can be specified in 3 ways: foo/bar Without any prefix, the mimetype will be treated as a regular string and will only match that exact mimetype. regex:foo?/b*r With the prefix "regex:", a simplified regular expression syntax can be used for matching mimetypes. A question mark (?) will match any single character while an asterisk (*) will match any number of characters, even none at all. For example, the preced‐ ing mimetype argument would match both "fool/bar" and "food/bor‐ rower" along with many others. Note that this regex is anchored at both the beginning and the end of the match. pregex:^(?:text|application)x-p.*[a-e].*$ The "pregex:" prefix enables full Perl regular expressions for powerful mimetype matching. You can learn more about Perl's regexes at http://perldoc.perl.org/perlre.html. Note that these regexes are not anchored. USAGE mimeman [options] For "--assoc", "--dissoc", "--prefer" and "--unpref", either a mimetype or a name (or both) must be specified. --mimetype Specify the mimetype. See the section SPECIFYING MIMETYPES above for further details. --app Specify an application by desktop file or command. Desktop files are specified by their basename and without the ".desktop" suf‐ fix. Commands may be specified by their full path or by their basename if they are on the system path. Desktop files take precedence over commands. To ensure that a command is used, specify the full path. When specifying commands, arguments may be given but must be quoted together with the command. --name Specify the "Name" of an application in a desktop file. This option is NOT mutually exclusive with "--app". --assoc Associate the given mimetype with the given application. --prefer Same as "--assoc" but additionally sets the application to the default. --dissoc The opposite of "--assoc". --unpref Remove a default. This does not affect other associations. --purge Attempt to clean up files in ~/.local/share/applications by removing redundant custom desktop files and associations for which there are no matching application desktop files. Use this with caution as it may be overzealous. If you are worried about losing file associations in this directory, back up its contents before running this command so that you can restore your current settings if you are not satisfied with the results. --help Display the help message. EXAMPLES mimeman --assoc --mimetype 'image/png' --app 'feh -F' --name 'feh: full screen' Associate png images with feh, using the name "feh: full screen" in launcher menus. If a corresponding desktop file does not exist, it will be created. mimeman --prefer --mimetype 'image/jpeg' --name 'feh: full screen' As above but for jpeg files. Note that "--app" was not speci‐ fied. This is because the previous command will have created a desktop file with the command "feh -F" and the name "feh: full screen", therefore the name is enough. This will also make "feh -F" the default association for jpeg images. mimeman --unpref --mimetype 'regex:image/*' --app '/usr/bin/feh -w' Remove all default image associations with "feh: full screen". mimeman --dissoc --mimetype 'regex:image/*' --app 'feh-usercreated-0' Remove all image associations with the custom desktop file "feh- usercreated-0.desktop", which is the file created by the first command. mimeman --purge Remove unused desktop files and dead associations. This would remove "feh-usercreated-0.desktop" if no other mimetypes were associated with it. AUTHORS Xyne August 2009 REBASE(1)