diff options
| author | rixx <rixx-git@cutebit.de> | 2015-03-30 14:26:31 +0200 |
|---|---|---|
| committer | rixx <rixx-git@cutebit.de> | 2015-03-30 14:38:28 +0200 |
| commit | 93c060a45f8de813caf7bd1b277b6c63490a5b80 (patch) | |
| tree | 4463f246abe8551ed83b237f0534b20c7efc79dc /py3status/modules | |
| parent | fe67b767bef6f307084b4a0993c5e84b26f5c487 (diff) | |
use /proc/<pid>/comm instead of /proc/<pid>/cmdline
In cmdline there is the complete call executed, which includes filenames
if you want to start a file directly (probably mostly important for
mplayer users). In comm, there is only the name of the executable.
Diffstat (limited to 'py3status/modules')
| -rw-r--r-- | py3status/modules/player_control.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py3status/modules/player_control.py b/py3status/modules/player_control.py index 6144462..062db49 100644 --- a/py3status/modules/player_control.py +++ b/py3status/modules/player_control.py @@ -114,10 +114,10 @@ class Py3status: if not pid.isdigit(): continue - fn = os.path.join('/proc', pid, 'cmdline') + fn = os.path.join('/proc', pid, 'comm') try: with open(fn, 'rb') as f: - player_name = f.read().decode().rstrip('\0') + player_name = f.read().decode().rstrip() except: continue |
