qtile: Restart/Shutdown of qtile from extension.CommandSet not working

Issue description

Tried to use extensions.CommandSet to write simple “Power menu”

After selecting restart qtile or logout, qtile freezes for couple of seconds.

Qtile version

0.18.0

Stack traces

  • ~/.xsession-errors
Traceback (most recent call last):
  File "/usr/lib64/python3.9/asyncio/streams.py", line 677, in read
    block = await self.read(self._limit)
  File "/usr/lib64/python3.9/asyncio/streams.py", line 684, in read
    await self._wait_for_data('read')
  File "/usr/lib64/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.9/asyncio/tasks.py", line 492, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/ipc.py", line 183, in async_send
    read_data = await asyncio.wait_for(reader.read(), timeout=10)
  File "/usr/lib64/python3.9/asyncio/tasks.py", line 494, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tokariew/.local/bin/qtile", line 8, in <module>
    sys.exit(main())
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/scripts/main.py", line 55, in main
    options.func(options)
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/scripts/cmd_obj.py", line 169, in cmd_obj
    ret = run_function(obj, args.function, args.args)
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/scripts/cmd_obj.py", line 131, in run_function
    ret = client.call(funcname, *args)
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/command/client.py", line 118, in call
    if name not in self.commands:
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/command/client.py", line 138, in commands
    return self._command.execute(command_call, (), {})
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/command/interface.py", line 231, in execute
    status, result = self._client.send((
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/ipc.py", line 163, in send
    return asyncio.run(self.async_send(msg))
  File "/usr/lib64/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib64/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/tokariew/.local/lib/python3.9/site-packages/libqtile/ipc.py", line 185, in async_send
    raise IPCError("Server not responding")
libqtile.ipc.IPCError: Server not responding
2021-08-30 19:13:20,448 ERROR libqtile loop.py:_handle_exception():L59 [Errno 32] Broken pipe
NoneType: None
  • ~/.local/share/qtile/qtile.log

Log file have only last 2 lines from .xsession-errors

Configuration

from libqtile import extension

key_exensions = Key([mod], 's', lazy.run_extension(extension.CommandSet(
    commands={
        'reboot': 'reboot',
        'shutdown': 'shutdown',
        'suspend': 'systemctl suspend',
        'lock session': '/home/tokariew/.local/bin/lockme',
        'restart qtile': 'qtile cmd-obj -o cmd -f restart',
        'logout': 'qtile cmd-obj -o cmd -f shutdown',
        },
    dmenu_lines=6))),

keys.extend(key_exensions)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 32 (32 by maintainers)

Most upvoted comments

If templates are still broken (sad face) let’s just delete the template and then re-add it when they are working again

On Tue, Dec 14 2021 at 04:36:47 -0800, elParaguayo @.***> wrote:

Was that if you tried to use the template? If so, just create a blank issue instead: https://github.com/qtile/qtile/issues/new

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Was that if you tried to use the template? If so, just create a blank issue instead: https://github.com/qtile/qtile/issues/new

OK - I think we need to create two new issues then as neither of these are directly related to the original one.

  • One for the extension not working after 4c0988c
  • One for the colours in DmenuRun which probably is related to d7016e1

Yeah, it should work. If the attribute has been set via a configuration parameter, it will retrieve the value. If not, it will return None. Either way that should work.

Hmm. Not sure why those colours aren’t working. Need to look at that.

As for keyboard grabbing, need to ping @m-col about that one…