-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-v1' into 'develop'
Resolve "Release-V1" See merge request rchaput/xdgprefs!9
- Loading branch information
Showing
21 changed files
with
223 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
.idea | ||
|
||
**/.cache | ||
build/** | ||
dist/** | ||
XDG_Prefs.egg-info/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,124 @@ | ||
# xdg-prefs | ||
# XDG-Prefs | ||
> Remy Chaput <[email protected]> | ||
Program that allows you to change the default application on your Linux system, | ||
using the [XDG standard](https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html). | ||
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][xdg-spec] to read and modify this | ||
database, allowing you to change your preferred default applications for | ||
each MIME type. The [XDG Specifications][xdg-spec] 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][freedesktop], and is not an official software of the | ||
[XDG Specifications][xdg-spec]. | ||
|
||
## Getting started | ||
|
||
Download the Wheel (.whl) file in the [releases] section and install it using | ||
`pip install XDG_Prefs-<version>-py3-none-any.whl` (replace `<version>` with | ||
the number of the version you downloaded, such as `0.1`: | ||
`XDG_Prefs-0.1-py3-none-any.whl`). | ||
Please note that you must use Python3.5 or later (you might need to replace | ||
`pip` with `pip3` on some distributions, such as Debian). | ||
|
||
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.5 or later (you might need to replace | ||
`python` with `python3` on some distributions, such as Debian). | ||
|
||
This will install the required files and create a `xdg-prefs` executable. | ||
|
||
## How to use | ||
|
||
Launch `xdg-prefs` (for example from the command line). On the interface you | ||
will see 3 panels (each associated to a tab): | ||
1. **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. | ||
2. **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. | ||
3. **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. | ||
|
||
## Features | ||
|
||
* Python implementation of multiples XDG Specifications. | ||
Directly reads the files that compose each of the following databases: | ||
* [Shared MIME Database][mime-spec] (list of all MIME types) | ||
* [Desktop Entry][apps-spec] (list of applications) | ||
* [MIME Applications Associations][xdg-spec] (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 | ||
|
||
## Dependencies | ||
|
||
This project only depends on | ||
* Python3.5 (should work with later versions) | ||
* PySide2 (Qt5 for Python ; tested with version 5.9.0a1) | ||
* configparser (Python standard library to read config files) | ||
* [future_fstrings](https://pypi.org/project/future-fstrings/) | ||
(in order to use PEP498's F-strings in Python3.5) | ||
* Uses code from https://github.com/wor/desktop_file_parser | ||
(in order to parse [Desktop files][apps-spec]) | ||
|
||
## Contributing | ||
|
||
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][issues]. | ||
|
||
You are also welcome to contribute to the code directly, in this case please | ||
refer to the [Contributing guidelines][contrib]. | ||
|
||
## Related projects | ||
|
||
Here's a list of other projects related to the [XDG Specifications][xdg-spec] | ||
and/or the setting of default applications on GNU/Linux: | ||
|
||
* [PyXDG](https://www.freedesktop.org/wiki/Software/pyxdg/) | ||
* [xdg-utils](https://www.freedesktop.org/wiki/Software/xdg-utils/), including: | ||
* [xdg-mime](http://portland.freedesktop.org/doc/xdg-mime.html) | ||
* [xdg-open](http://portland.freedesktop.org/doc/xdg-open.html) | ||
* gnome-default-applications-properties | ||
|
||
## Licensing | ||
|
||
This project is licensed under the [Apache License][license]. | ||
|
||
Basically, this means that you are allowed to modify and distribute this | ||
project, but you must include the [License][license] file and state the | ||
changes you've made (please refer to the [License][license] file or the | ||
https://choosealicense.com/licenses/apache-2.0/ website for the full | ||
list of permissions, conditions and limitations). | ||
|
||
[issues]:issues/new | ||
[releases]:releases/ | ||
[xdg-spec]:https://www.freedesktop.org/wiki/Specifications/mime-apps-spec/ | ||
[freedesktop]:https://www.freedesktop.org/wiki/ | ||
[mime-spec]:https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/ | ||
[apps-spec]:https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/ | ||
[contrib]:./CONTRIBUTING | ||
[license]:./LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pyside2 | ||
future_fstrings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
from setuptools import setup | ||
|
||
|
||
def read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
|
||
setup( | ||
name='XDG-Prefs', | ||
version='0.1', | ||
|
||
packages=['xdgprefs', 'xdgprefs.core', 'xdgprefs.gui'], | ||
install_requires=['PySide2', 'future-fstrings'], | ||
|
||
entry_points={ | ||
'gui_scripts': [ | ||
'xdg-prefs = xdgprefs.__main__:main' | ||
] | ||
}, | ||
|
||
|
||
author='Remy Chaput', | ||
author_email='[email protected]', | ||
description='A GUI program to view and change your default programs\' ' | ||
'preferences (which program should open which type of file), ' | ||
'using the XDG Specifications', | ||
long_description=read('README.md'), | ||
long_description_content_type='text/markdown', | ||
|
||
license='Apache', | ||
keywords='GUI MIME preferences XDG', | ||
platforms=['GNU/Linux'], | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: X11 Applications', | ||
'Intended Audience :: End Users/Desktop', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Natural Language :: English', | ||
'Operating System :: Unix', | ||
'Programming Language :: Python :: 3.5', | ||
'Topic :: Utilities' | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Entry-point of the xdg-prefs software. | ||
""" | ||
|
||
|
||
import sys | ||
from PySide2.QtWidgets import QApplication | ||
|
||
from xdgprefs.gui.main_window import MainWindow | ||
|
||
|
||
def main(): | ||
app = QApplication(sys.argv) | ||
window = MainWindow() | ||
window.show() | ||
sys.exit(app.exec_()) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: future_fstrings -*- | ||
""" | ||
This module defines a single Application Item in the AppsPanel. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: future_fstrings -*- | ||
""" | ||
This module defines a single MimeTypeItem in the MimeTypePanel. | ||
""" | ||
|
Oops, something went wrong.