From 93c060a45f8de813caf7bd1b277b6c63490a5b80 Mon Sep 17 00:00:00 2001 From: rixx Date: Mon, 30 Mar 2015 14:26:31 +0200 Subject: use /proc//comm instead of /proc//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. --- py3status/modules/player_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py3status/modules') 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 -- cgit v1.3