scripts
scripts copied to clipboard
lnotify 0.3.4 is incompatible with procps-ng 3.3.12
The lnotify script uses ps to determine the name of the currently running window, but it uses command line arguments that are not supported by the version of ps in many distributions. The generate command line looks like:
ps -ho comm -p xterm
And fails like this:
error: unsupported SysV option
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
Note this is a different failure than the one reported in #334.
@kevr I think this is your plugin. What is the ignore_windows_list code for? It currently has a somewhat arbitrary list of terminal names that is not user-configureable, and this particular chunk of code is responsible for multiple failures.
I wonder if we should:
(a) just remove it:
diff --git a/python/lnotify.py b/python/lnotify.py
index 5070ba3..f3a20ac 100644
--- a/python/lnotify.py
+++ b/python/lnotify.py
@@ -94,20 +94,8 @@ def handle_msg(data, pbuffer, date, tags, displayed, highlight, prefix, message)
buffer_type = weechat.buffer_get_string(pbuffer, "localvar_type")
away = weechat.buffer_get_string(pbuffer, "localvar_away")
x_focus = False
- window_name = ""
my_nickname = "nick_" + weechat.buffer_get_string(pbuffer, "localvar_nick")
- # Check if active window is in the ignore_windows_list and skip notification
- if (environ.get('DISPLAY') != None) and path.isfile("/bin/xdotool"):
- cmd_pid="xdotool getactivewindow getwindowpid".split()
- window_pid = subprocess.check_output(cmd_pid)
- cmd_name=("ps -ho comm -p %s"%(window_pid)).split()
- window_name = subprocess.check_output(cmd_name)
- ignore_windows_list = ["tilda", "gnome-terminal", "xterm"]
- if window_name in ignore_windows_list:
- x_focus = True
- return weechat.WEECHAT_RC_OK
-
if pbuffer == weechat.current_buffer() and x_focus:
return weechat.WEECHAT_RC_OK
Or (b) make it user configurable? I'm not clear what the intent is here (e.g., as currently written, this code will suppress notifications whenever I'm using an gnome-terminal terminal, which seems odd).
The
lnotifyscript usespsto determine the name of the currently running window, but it uses command line arguments that are not supported by the version ofpsin many distributions. The generate command line looks like:ps -ho comm -p xtermAnd fails like this:
error: unsupported SysV option Usage: ps [options] Try 'ps --help <simple|list|output|threads|misc|all>' or 'ps --help <s|l|o|t|m|a>' for additional help text. For more details see ps(1).Note this is a different failure than the one reported in #334.
I have the same issue fwiw @larsks
I wonder if we should:
(a) just remove it:
Yes, I would say so. The choice of window titles seems completely arbitrary.
I would be quite surprised if anyone is actually relying on this (now completely broken) functionality at all.