Remy Chaput [email protected]
On GNU/Linux systems, each file has an associated MIME Type (or Media Type) that represents the kind of content (for example, image/jpeg). Your system uses a database to list your preferences for default applications (for example, to use eog as default application for image/jpeg).
XDG-Prefs uses the XDG Specifications to read and modify this
database, allowing you to change your preferred default applications for
each MIME type. The XDG Specifications is the reference
specification for MIME types and default applications, meaning that the
preferences you will set in XDG-Prefs will be recognized by all other
XDG-compliant softwares (such as xdg-open
, which is typically used when
you double-click on a file).
Usually, Desktop Environments (such as Gnome, or KDE) provide some kind of tool to manage these preferences ; this software works on every Window Manager (including those that are not Desktop Environments, such as i3wm).
Note: XDG-Prefs is not associated with the Freedesktop Organization, and is not an official software of the XDG Specifications.
Follow these instructions to install the required files and create a xdg-prefs
executable.
(Note: you might need to replace pip
with pip3
on some distributions, such as Debian).
You may install XDG-Prefs by using pip install git+https://github.com/rchaput/xdg-prefs
(or pip install --user git+https://github.com/rchaput/xdg-prefs
if you prefer
installing for the current user only).
If you are unsure about your Qt version, try this latest release first.
You need to use the older v0.2 of XDG-Prefs that relies on dependencies still
compatible with such versions of Python and Qt, by using
pip install git+https://github.com/rchaput/[email protected]
.
Alternatively, you can clone this project on your computer and run
python setup.py install
. This is recommended if you want to contribute.
Again, you will need to use Python3.9 or later (you might need to replace
python
with python3
on some distributions, such as Debian).
Launch xdg-prefs
(for example from the command line). On the interface you
will see 3 panels (each associated to a tab):
- Associations: allows you to see the current default application for each MIME Type. Simply click on the list, on the left of a given MIME Type to see the list of possible applications. Click on one of them to set it as the default application.
- List MIME Types: allows you to see the list of known MIME types on your computer, and to search for specifics MIME types. Even MIME types which do not have an associated default application are listed here.
- List Applications: allows you to see the list of known applications on your computer (that is, those with a .desktop file). You can see the list of MIME types each application is able to handle, and a description of the application.
XDG-Prefs will print logs on the bottom of the interface, especially when you set a new default application.
- Python implementation of multiples XDG Specifications.
Directly reads the files that compose each of the following databases:- Shared MIME Database (list of all MIME types)
- Desktop Entry (list of applications)
- MIME Applications Associations (preferences for default applications)
- Qt5 interface
- allows to see and filter list of MIME types
- allows to see and filter list of applications
- allows to see and change the default application associated to each MIME type
- Works with every window manager
This project only depends on
- Python3.9 (should work with later versions)
- PySide6 (Qt6 for Python)
- configparser (Python standard library to read config files)
- Uses code from https://github.com/wor/desktop_file_parser (in order to parse Desktop files)
This is an Open-Source projects, your contributions are very welcome.
If you have an idea for a new feature, an optimization or if you notice a bug, feel free to open an issue.
You are also welcome to contribute to the code directly, in this case please refer to the Contributing guidelines.
Here's a list of other projects related to the XDG Specifications and/or the setting of default applications on GNU/Linux:
This project is licensed under the Apache License.
Basically, this means that you are allowed to modify and distribute this project, but you must include the License file and state the changes you've made (please refer to the License file or the https://choosealicense.com/licenses/apache-2.0/ website for the full list of permissions, conditions and limitations).