diff --git a/README.md b/README.md index 55559e1..5bbc0d2 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,10 @@ Documentation is [available here](http://clay.readthedocs.io/en/latest/). - [gmusicapi] (PYPI) - [urwid] (PYPI) - [PyYAML] (PYPI) -- [PyGObject] (native, optional, used for global X keybinds) -- [Keybinder] (native, optional, used for global X keybinds) - lib[VLC] (native, distributed with VLC player) +- [PyGObject] (optional) (native, used for global X keybinds) +- [Keybinder] (optional) (native, used for global X keybinds) +- [setproctitle] (optional) PYPI, used to change clay process name from 'python' to 'clay') # What works - Playback @@ -244,3 +245,4 @@ People who contribute to this project: [pyyaml]: https://github.com/yaml/pyyaml [PyGObject]: https://pygobject.readthedocs.io/en/latest/getting_started.html [Keybinder]: https://github.com/kupferlauncher/keybinder +[setproctitle]: https://pypi.org/project/setproctitle/ diff --git a/clay/app.py b/clay/app.py index 30d8122..2a6f2b3 100755 --- a/clay/app.py +++ b/clay/app.py @@ -27,6 +27,7 @@ from clay.notifications import notification_area from clay.gp import gp from clay.hotkeys import hotkey_manager + class AppWidget(urwid.Frame): """ Root widget. @@ -326,7 +327,7 @@ def main(): """ Application entrypoint. - This method is required to allow Clay to be ran an application when installed via setuptools. + This function is required to allow Clay to be ran as application when installed via setuptools. """ parser = argparse.ArgumentParser( prog=meta.APP_NAME, @@ -363,6 +364,13 @@ def main(): palette = [(name, '', '', '', res['foreground'], res['background']) for name, res in settings.colours_config.items()] + try: + from setproctitle import setproctitle + except ImportError: + pass + else: + setproctitle('clay') + # Run the actual program app_widget = AppWidget() loop = urwid.MainLoop(app_widget, palette)