Closed systemoperator closed 2 years ago
I'm not sure what would cause this.
I have just added checking for wmctrl
at startup, so that might help?
@dflock I've tested the current version. When starting ulauncher
, the following errors appear now:
main@w ~ % ulauncher
(ulauncher:18995): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
File "/home/w/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py", line 80
description=f'Workspace {window["ws"]}: {ws_dict[window["ws"]]}, Window Id: {w_idx}',
^
SyntaxError: invalid syntax
2021-11-26 16:35:27,539 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.dflock.ulauncher-window-switcher" exited instantly with code 1
2021-11-26 16:35:27,540 | ERROR | ulauncher.api.server.ExtensionRunner: _run_process() | Extension "com.github.dflock.ulauncher-window-switcher" failed with an error: SyntaxError: invalid syntax
It seems to be a clash in the Python version, with unsupported features.
Replacing Line 80 with
description='Workspace ' + window["ws"] + ": " + ws_dict[window["ws"]] + ", Window Id: " + {w_idx},
and Line 81 with
on_enter=RunScriptAction("wmctrl -ia " + w_idx),
in /home/w/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py
and running ulauncher
again, it only shows:
main@w ~ % ulauncher
(ulauncher:26311): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
When now trying to search for an open window, no windows appear in the list. The only entry is called "Loading...".
When quitting ulauncher
from terminal, the following appears:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ulauncher/api/client/Client.py", line 54, in on_message
self.extension.trigger_event(event)
File "/usr/lib/python3/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
action = listener.on_event(event, self)
File "/home/w/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py", line 47, in on_event
text=True,
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ulauncher/api/client/Client.py", line 54, in on_message
self.extension.trigger_event(event)
File "/usr/lib/python3/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
action = listener.on_event(event, self)
File "/home/w/.local/share/ulauncher/extensions/com.github.dflock.ulauncher-window-switcher/main.py", line 47, in on_event
text=True,
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
com.github.dflock.ulauncher-window-switcher | 2021-11-26 16:43:54,553 | WARNING | ulauncher.api.client.Client: on_close() | Connection closed. Exiting
At least, the extension does not crash anymore.
Ugh, right - Python 3.5 doesn't have f strings! Sorry!
Fixed by https://github.com/dflock/ulauncher-window-switcher/commit/a5652bacdee7054930c5c4a791e5f9e78437da41
@dflock Which Python version do you use?
As it can be seen in the logs above, there is still is a problem with the call to subprocess.run()
:
result = subprocess.run(
['wmctrl -l | awk \'{ if( $2 != "-1") { $3=""; print $0} }\''],
capture_output=True,
shell=True,
text=True,
).stdout
Here capture_output=True,
seems to be problematic:
TypeError: __init__() got an unexpected keyword argument 'capture_output'
The same applies to text=True
.
After installing, the extension crashes and the following message appears:
I can't even change and save the keyword for triggering the extension.
OS: Ubuntu 16.04 python -V: Python 2.7.12 python3 -V: Python 3.5.2
Launching with
ulauncher -v
shows (when restarting ulauncher with this extension already installed) or when freshly installing the extension:When installing and saving the settings:
Message: 'com.github.dflock.ulauncher-window-switcher' Error Name: UnhandledError Type: KeyError
Stacktrace:
Where
ulauncher -v
showed:Sometimes, I could grab the following error:
Message: 'com.github.dflock.ulauncher-window-switcher' Error Name: UnhandledError Type: KeyError
Stacktrace:
Once, I only got:
Message: undefined Error Name: undefined Type: undefined
Stacktrace: