From f669bd9bedcaaf586ff93799178c6f31187bd8e7 Mon Sep 17 00:00:00 2001 From: Lionel Dricot Date: Fri, 18 Feb 2022 23:50:08 +0100 Subject: [PATCH] change process name to offpunk --- README.md | 3 ++- offpunk.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0b785f..694fb68 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Announces about Offpunk will be made on Ploum’s Gemlog => gemini://rawtext.cl ## Dependencies Offpunk has no "strict dependencies", i.e. it will run and work without anything -else beyond the Python standard library. However, it will "opportunistically +else beyond the Python standard library and the "less" pager. However, it will "opportunistically import" a few other libraries if they are available to offer an improved experience or some other features. Python libraries requests, bs4 and readabliity are required for http/html support. @@ -84,6 +84,7 @@ Run command `version` in offpunk to see if you are missing some dependencies. * [Xsel](http://www.vergenet.net/~conrad/software/xsel/) allows to `go` to the URL copied in the clipboard without having to paste it (both X and traditional clipboards are supported). Also needed to use the `copy` command. (apt-get install xsel) * [Chafa](https://hpjansson.org/chafa/) allows to display pictures in your console. Install it and browse to an HTML page with picture to see the magic. * [Python-pil](http://python-pillow.github.io/) is required to only display the first frame of animated gif with chafa. +* [Python-setproctitle](https://github.com/dvarrazzo/py-setproctitle) will change the process name from "python" to "offpunk". Useful to kill it without killing every python service. ## Features diff --git a/offpunk.py b/offpunk.py index 90307ab..2c80a01 100755 --- a/offpunk.py +++ b/offpunk.py @@ -45,6 +45,13 @@ import urllib.parse import uuid import webbrowser +try: + import setproctitle + setproctitle.setproctitle("offpunk") + _HAS_SETPROCTITLE = True +except ModuleNotFoundError: + _HAS_SETPROCTITLE = False + try: import editor _HAS_EDITOR = True @@ -2630,6 +2637,7 @@ Think of it like marks in vi: 'mark a'='ma' and 'go a'=''a'.""" output += " - python-bs4 : " + has(_HAS_SOUP) output += " - python-readability : " + has(_HAS_READABILITY) output += " - python-xdg : " + has(_HAS_XDG) + output += " - python-setproctitle : " + has(_HAS_SETPROCTITLE) output += " - chafa : " + has(_HAS_CHAFA) output += " - xsel : " + has(_HAS_XSEL)