fix(linux): fix regex to detect running ibus-daemon

On Ubuntu 20.04 Focal ibus gets started by a shell command so that we
end up with two processes mentioning `ibus-daemon`. This change limits
the search to processes that specify with full path to `ibus-daemon` or
without path, but `ibus-daemon` has to be the command, not a parameter.
This commit is contained in:
Eberhard Beilharz 2024-02-26 18:40:23 +01:00
parent d396a397e3
commit 8ff35c8657
No known key found for this signature in database
GPG key ID: E9140597606020D3

View file

@ -115,7 +115,7 @@ def verify_ibus_daemon(start):
try:
ps_output = subprocess.run(('ps', '--user', user, '-o', 's=', '-o', 'cmd'),
check=False, stdout=subprocess.PIPE).stdout
ibus_daemons = re.findall('^[^ZT] (.*/|)ibus-daemon( .*|$)',
ibus_daemons = re.findall(r'^[^ZT] (/[^ ]+/|)ibus-daemon( .*|$)',
ps_output.decode('utf-8'), re.MULTILINE)
if len(ibus_daemons) <= 0:
if start: