Qtile grow window keybinding doesn't work

Hi.
first, I’m not good in English.
I installed EndeavourOS Qtile Edition less than a week.
I used Qtile about one year and know something about it.
the grow window keybinding in Eos config doesn’t work.
I use mod + control + h, j, k and l but nothing happened. if I use the default config of Qtile itself. this keybinding work fine and window size will change correctly but with Eos config, nothing !!!

1 Like

Are you sure you copied all the folders required for qtile on eos?

I can see that these keybindings are in the .config/qtile/modules/keys.py folder. The eos version is not the typical one file config.py, looks like additional script and modules were prepared.

files are in the right location by default.
configs seems to be without any problem but I can’t change size of windows.

-rwxr-xr-x 1 smjt2000 smjt2000    402 May  9 00:12 autostart.sh
-rw-r--r-- 1 smjt2000 smjt2000    604 Jul 24 10:59 config.py
-rw-r--r-- 1 smjt2000 smjt2000   8097 Jul 24 14:33 default.py
-rw-r--r-- 1 smjt2000 smjt2000 805413 May  9 00:12 eos-c.png
drwxr-xr-x 3 smjt2000 smjt2000   4096 Jul 26 20:55 modules
drwxr-xr-x 2 smjt2000 smjt2000   4096 Jul 26 20:46 __pycache__
drwxr-xr-x 2 smjt2000 smjt2000   4096 Jul 24 10:53 scripts

./modules:
total 32
-rw-r--r-- 1 smjt2000 smjt2000 1122 May  9 00:12 groups.py
-rw-r--r-- 1 smjt2000 smjt2000  191 May  9 00:12 hooks.py
-rw-r--r-- 1 smjt2000 smjt2000 3141 Jul 26 20:55 keys.py
-rw-r--r-- 1 smjt2000 smjt2000  994 May  9 00:12 layouts.py
-rw-r--r-- 1 smjt2000 smjt2000  397 May  9 00:12 mouse.py
drwxr-xr-x 2 smjt2000 smjt2000 4096 Jul 26 20:55 __pycache__
-rw-r--r-- 1 smjt2000 smjt2000 3697 May  9 00:12 screens.py
-rw-r--r-- 1 smjt2000 smjt2000 1748 May  9 00:12 widgets.py

./modules/__pycache__:
total 28
-rw-r--r-- 1 smjt2000 smjt2000  873 Jul 24 10:55 groups.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000  440 Jul 24 10:55 hooks.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000 2068 Jul 26 20:55 keys.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000  611 Jul 24 10:55 layouts.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000  504 Jul 24 10:55 mouse.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000 2072 Jul 24 10:55 screens.cpython-310.pyc
-rw-r--r-- 1 smjt2000 smjt2000 1650 Jul 24 10:55 widgets.cpython-310.pyc

./__pycache__:
total 4
-rw-r--r-- 1 smjt2000 smjt2000 757 Jul 26 20:46 config.cpython-310.pyc

./scripts:
total 8
-rwxr-xr-x 1 smjt2000 smjt2000  954 May  9 00:12 check_battery.sh
-rwxr-xr-x 1 smjt2000 smjt2000 1182 May  9 00:12 low_bat_notifier.sh

Are these all located under .config/qtile in your home folder? Couldn’t gather that info from your post.

If you change other things in your config does it pick it up when you restart/refresh qtile? Just trying fonts or something similar?

yes. these files are located under ~/.config/qtile.
I just added a keybinding for firefox:

mod = "mod4"
terminal = "xfce4-terminal"
browser = "firefox"
...
...
    Key([mod], "b", lazy.spawn(browser))

What I would probably do is download the default qtile config file (not the one from EOS) and try adding the resize window script.

We don’t really know changes you may have done to the eos qtile config file on your system with the snippet of script you posted here, so it’s difficult to troubleshoot.

If you used the default eos qtile files and configs without any changes and it didn’t work, I suggest contacting the git repo maintainer @codic12 to check it out…

They’re definitely bound keys:

    Key([mod, "control"],
        "h",
        lazy.layout.grow_left(),
        desc="Grow window to the left"),
    Key([mod, "control"],
        "l",
        lazy.layout.grow_right(),
        desc="Grow window to the right"),
    Key([mod, "control"],
        "j",
        lazy.layout.grow_down(),
        desc="Grow window down"),
    Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),

So I have no clue why it doesn’t work for you. Can you try checking qtile’s logs?

I don’t know how to check Qtile’s log!!

https://docs.qtile.org/en/latest/manual/troubleshooting.html

When Qtile is running, it logs error messages (and other messages) to its log file. This is found at ~/.local/share/qtile/qtile.log. This is the first place to check to see what is going on. If you are getting unexpected errors from normal usage or your configuration (and you’re not doing something wacky) and believe you have found a bug, then please report a bug.

Here is logs:

2022-07-29 13:58:01,510 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-07-29 13:58:01,650 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-07-29 13:58:01,919 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_right: No such command
2022-07-29 13:58:41,576 WARNING libqtile lifecycle.py:_atexit():L33 Restarting Qtile with os.execv(...)
2022-07-29 14:06:16,074 WARNING libqtile lifecycle.py:_atexit():L37 Qtile will now terminate
2022-07-29 20:10:18,914 ERROR libqtile core.py:_xpoll():L335 Got an exception in poll loop
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/libqtile/backend/x11/core.py", line 303, in _xpoll
    ret = target(event)
  File "/usr/lib/python3.10/site-packages/libqtile/backend/x11/window.py", line 1151, in handle_KeyPress
    self.process_key_press(keysym)
  File "/usr/lib/python3.10/site-packages/libqtile/bar.py", line 524, in process_key_press
    if self.has_keyboard:
  File "/usr/lib/python3.10/site-packages/libqtile/configurable.py", line 48, in __getattr__
    raise AttributeError("%s has no attribute: %s" % (cname, name))
AttributeError: Bar has no attribute: has_keyboard
2022-07-29 20:26:19,887 WARNING libqtile lifecycle.py:_atexit():L37 Qtile will now terminate
2022-08-07 00:25:50,719 ERROR libqtile base.py:_wrapper():L353 got exception from widget timer
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/libqtile/widget/base.py", line 351, in _wrapper
    method(*method_args)
  File "/usr/lib/python3.10/site-packages/libqtile/widget/volume.py", line 126, in update
    vol = self.get_volume()
  File "/usr/lib/python3.10/site-packages/libqtile/widget/volume.py", line 188, in get_volume
    mixer_out = self.call_process(get_volume_cmd)
  File "/usr/lib/python3.10/site-packages/libqtile/widget/base.py", line 338, in call_process
    return subprocess.check_output(command, **kwargs, encoding="utf-8")
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'amixer'
2022-08-07 00:26:36,878 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-08-07 00:26:37,014 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-08-07 00:26:37,884 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_down: No such command
2022-08-07 00:26:38,006 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_up: No such command
2022-08-07 00:26:38,178 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_up: No such command
2022-08-07 00:26:38,419 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-08-07 01:37:41,958 WARNING libqtile lifecycle.py:_atexit():L37 Qtile will now terminate
2022-08-09 11:35:22,092 WARNING libqtile lifecycle.py:_atexit():L37 Qtile will now terminate
2022-08-09 23:09:10,252 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-08-09 23:09:10,396 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_left: No such command
2022-08-09 23:09:10,610 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_right: No such command
2022-08-09 23:09:10,766 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_right: No such command
2022-08-09 23:09:10,924 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_right: No such command

It doesn’t work for me either. And I’m using MonadTall layout, which is default in EOS. It works only if I use Columns layout.

FileNotFoundError: [Errno 2] No such file or directory: 'amixer'

Unrelated but can be fixed by alsa-utils. I thought this was part of the eos base pkg, but I’ll add it to packages_repository.txt. The has_keyboard issue is upstream qtile and happens when a config is split across files, but also unrelated. Can you see if in ~/.config/qtile/modules/keys.py changing grow_left/grow_right to shrink/grow respectively works? (apparently monadtall doesn’t have the methods, maybe it was recent change?) If so, I can commit that upstream. (edit: alsa-utils is already in there, so your configuration is broken!)

at one point I understood the config, but with the number of changes made with PRs, I admit not anymore!

here is the ~/.config/qtile/modules/keys.py :

from libqtile.lazy import lazy
from libqtile.config import Key

mod = "mod4"
terminal = "xfce4-terminal"
browser = "firefox"

keys = [
    # Switch between windows
    Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
    Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
    Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
    Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
    Key([mod],
        "space",
        lazy.layout.next(),
        desc="Move window focus to other window"),

    Key([mod], "r", lazy.spawn("rofi -show combi"), desc="spawn rofi"),

    # Move windows between left/right columns or move up/down in current stack.
    # Moving out of range in Columns layout will create new column.
    Key([mod, "shift"],
        "h",
        lazy.layout.shuffle_left(),
        desc="Move window to the left"),
    Key([mod, "shift"],
        "l",
        lazy.layout.shuffle_right(),
        desc="Move window to the right"),
    Key([mod, "shift"],
        "j",
        lazy.layout.shuffle_down(),
        desc="Move window down"),
    Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),

    # Grow windows. If current window is on the edge of screen and direction
    # will be to screen edge - window would shrink.
    Key([mod, "control"],
        "h",
        lazy.layout.grow_left(),
        desc="Grow window to the left"),
    Key([mod, "control"],
        "l",
        lazy.layout.grow_right(),
        desc="Grow window to the right"),
    Key([mod, "control"],
        "j",
        lazy.layout.grow_down(),
        desc="Grow window down"),
    Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
    Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),

    # Toggle between split and unsplit sides of stack.
    # Split = all windows displayed
    # Unsplit = 1 window displayed, like Max layout, but still with
    # multiple stack panes
    Key([mod, "shift"],
        "Return",
        lazy.layout.toggle_split(),
        desc="Toggle between split and unsplit sides of stack"),
    Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),

    # Toggle between different layouts as defined below
    Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
    Key([mod], "w", lazy.window.kill(), desc="Kill focused window"),
    Key([mod, "shift", "control"], "h", lazy.layout.swap_column_left()),
    Key([mod, "shift", "control"], "l", lazy.layout.swap_column_right()),
    Key([mod, "shift"], "space", lazy.layout.flip()),
    Key([mod, "control"], "r", lazy.restart(), desc="Restart Qtile"),
    Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
    Key([mod, "shift"],
        "r",
        lazy.spawncmd(),
        desc="Spawn a command using a prompt widget"),
    Key([], "XF86AudioRaiseVolume",lazy.spawn("amixer set Master 3%+")),
    Key([], "XF86AudioLowerVolume",lazy.spawn("amixer set Master 3%-")),
    Key([], "XF86AudioMute",lazy.spawn("amixer set Master toggle")),
    Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +5")),
    Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 5-")),


    Key([mod], "b", lazy.spawn(browser)),
]

I know that, I was asking if you could test this for me because I don’t have access to qtile at the moment :slight_smile:

Can you see if in ~/.config/qtile/modules/keys.py changing grow_left/grow_right to shrink/grow respectively works?

Aren’t you the qtile community maintainer :laughing: :shushing_face:

I am using Qtile as my daily driver. the grow shrink does not work in all layouts. please pay attention to what @dorinakis said above, besides

  • if focus is on the application running on the left then i will be able to grow it only on the right.

  • if focus is on the application running on the right then i will be able to grow it only on the left.

yes, but I’ve been overseas for a while without real access to my *nix computer :slight_smile:

and now I am on finally a nice alpine linux laptop. sorry for procrastinating so long, but it’s fixed now.

@pannet1 we can only support so many layouts, right now we either support having one full maximized layout or monadtall, otherwise the user can build their own.

if focus is on the application running on the left then i will be able to grow it only on the right…

can’t reproduce this, can you try the latest master?

2 Likes

oops, sorry i didn’t mean to complain, because i am on my own config borrowed from woff os. I was only trying to help @smjt2000 on Qtile in small way possible. I thought the above behavior is normal and reduced my expectations.

if an application is running on the leftmost side of the window, its left is attached there and obviously i do not want it to grow beyond the viewport (on the left). so this implies that the growth can only happen on the right.

my experiments were only on a 1x2 grid since i did not have an use case of running 1x3 grid. may be it will work on the 1x3 grid for the app running in the middle of apps running on either side.

sorry for the confusions. i fully understand you cannot possibly support user modified custom configuration.

1 Like

The layout MonadTall doesn’t support the grow_right(), grow_left(), grow_up() and grow_down() methods. It does support the grow() and shrink() methods, however, as well as grow_main() and shrink_main(). To change the size of the main pane versus the other panes, (i.e. the functionality that would be covered by grow_right and grow_left were they to be implemented) you can either select the main pane and call the grow or shrink command or use the grow_main and shrink_main commands. Similarly, instead of using grow_up and grow_down, one has to select the appropriate secondary pane and use a combination of grow and shrink commands to achieve the desired result.

All of this is directly from the qtile docs’ MonadTall section. My qtile logs confirm it:

2022-09-21 23:38:34,398 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_down: No such command
2022-09-21 23:38:34,502 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_up: No such command
2022-09-21 23:38:34,545 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_right: No such command
2022-09-21 23:38:34,666 ERROR libqtile manager.py:process_key_event():L392 KB command error grow_down: No such command

(above logs produced using the MonadTall layout with the default EndeavorOS qtile config in regards to keybindings)

I see that the issue has already been resolved but I figured I’d leave a verbose explanation for anyone who stumbles across this thread like I did.

1 Like

Welcome to the EndeavourOS forum. I hope you enjoy your time here.

Thank You for your input.

Pudge

1 Like