Where to put custom layout class?

18 views
Skip to first unread message

Stephen Paul Weber

unread,
Oct 16, 2021, 11:21:48 PM10/16/21
to qtile-dev
If I define a custom layout in config.py like so:

class MyLayout(layout.Columns):
    def add_column(self, prepend=False):
        layout.Columns.add_column(self, prepend)

then it works, but when I restart qtile it always crashes. Where should I prefer to put this so it will work better?

James Wright

unread,
Oct 17, 2021, 1:27:57 AM10/17/21
to qtil...@googlegroups.com
What does the log file report?

And what do you mean by "it works" but on restart it crashes?

--
You received this message because you are subscribed to the Google Groups "qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtile-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/a9881a74-af90-4e36-bc06-ff039d0a282dn%40googlegroups.com.

elParaguayo

unread,
Oct 17, 2021, 3:42:16 AM10/17/21
to qtile-dev
Agree with James's questions. No reason for it to work but crash on restart.

As for where to put custom classes, it's really up to you. If it's small, it's fine for it to be in the config file. If not, put it in a file that's in your python path and import it.

The simplest thing would be to create a file in the same folder as config.py. Let's say it's called mylayout.py then, in your config file, just do "from mylayout import MyLayout".

Stephen Paul Weber

unread,
Oct 17, 2021, 8:42:07 PM10/17/21
to qtile-dev
Ah, managed to find the logfile, thanks for that. Seems the issue was that I was not returning the result of the super call, which is required. Weird that it sometimes worked and sometimes not, but now it always works :)
Reply all
Reply to author
Forward
0 new messages