qtile: Unable to spawn extension.WindowList

Issue description

When I try to launch the WindowList extension it fails and I get an error.

Qtile version

0.18.1

Stack traces

and the stacktrace:

2021-09-30 18:33:24,691 ERROR libqtile manager.py:process_key_event():L361 KB command error run_extension: Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/libqtile/command/interface.py", line 313, in call
    return SUCCESS, cmd(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/libqtile/core/manager.py", line 1525, in cmd_run_extension
    extension.run()
  File "/usr/lib/python3.9/site-packages/libqtile/extension/window_list.py", line 58, in run
    out = super().run(items=self.item_to_win.keys())
  File "/usr/lib/python3.9/site-packages/libqtile/extension/dmenu.py", line 96, in run
    proc = super().run()
  File "/usr/lib/python3.9/site-packages/libqtile/extension/base.py", line 99, in run
    return Popen(self.configured_command, stdout=PIPE, stdin=PIPE)
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1754, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not list

Configuration

The config is:

from libqtile import extension
from libqtile.lazy import lazy

keys.append(
        Key([mod], "semicolon",
            lazy.run_extension(extension.WindowList(
                dmenu_prompt = 'Switch to:',
                dmenu_command = '/usr/bin/dmenu',
    ))))

My dmenu supports the height / -h option.

About this issue

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

Most upvoted comments

Cool. Yes, that’s the problem.

This isn’t the same as bar colours which can be a gradient. This is a value which gets passed to dmenu so qtile isn’t responsible for drawing it.

Thank you! this is now working

        lazy.run_extension(WindowList(
            dmenu_prompt = 'Switch to:',
            dmenu_command = 'dmenu',
            background= '#555555',
            foreground='#DBDBDB')
        ),

had the same idea when looking at the log output. But the problem is inherited from the colors List in config.py because this list implicitely referenced inside Dmenu class by self.background and self.foreground.

colors = [["#555555", "#555555"],  # panel background
          ["#434758", "#434758"],  # background for current screen tab
          ["#DBDBDB", "#DBDBDB"],  # font color for group names
          ["#ff5555", "#ff5555"],  # background color for layout widget
          ["#8BB158", "#8BB158"],  # dark green gradiant for other screen tabs
          ["#7197E7", "#7197E7"]]  # background color for pacman widget

Not sure that’s right, presumably you set foreground=colors[0] in your config. If so, you’ve passed a list. You should have passed colors[0][0].

No default colours are passed to the extension and there’s no “implicit” reference either.

here is the problem. When I wrote that code, I thought that foreground and background can be color gradients.

widget_defaults = dict(
        font="Ubuntu",
        fontsize=font_scale(13),
        icon_size=font_scale(20),
        padding=font_scale(5),
        linewidth=font_scale(1),
        foreground=colors[2],
        background=colors[0]
        )
extension_defaults = widget_defaults.copy()

again, thank you for your help.

$ python --version Python 2.7.18

Also, what system are you on?! We don’t support python 2.7.