numirias / qtile-plasma

🔮 A flexible, tree-based layout for Qtile
MIT License
97 stars 12 forks source link

setting width from qtile shell / client_managed hook #20

Open skaface opened 3 years ago

skaface commented 3 years ago

Hi, Ive been trying to set the width of a program from within a hook, so that as soon as I launch for example MPV, it will resize it to a width of 1920. On trying to run the command from qtile shell, layout > width(500)

File "/home/gary/.local/lib/python3.9/site-packages/plasma/node.py", line 328, in size val = max(min(val, self.parent.capacity - occupied), TypeError: '<' not supported between instances of 'int' and 'str'

I am sorry, I don't know how to submit a patch, but I fixed this by changing line 328 of node.py to

val = max(min(int(val), self.parent.capacity - occupied),

to change the type of val to an integer

I am still having trouble calling the width function directly from within a hook, but I am unsure if I am doing it correctly or if this is just unsupported, I would be appreciative if you could give me some direction on how to accomplish this? I have a rather hacky solution in place at the moment to simulate a keypress which is bound to the lazy.layout.width() function

Thank you