Rules in Qtile

Hi,

I am moving from BSPWM to Qtile but I am trying figure if rules are supported but I can find anything on the Qtile documentation.

What I am trying to do is have rules that will send certain applications to specific desktops. Eg send firefox to desktop 2

On bspwm I would do something like this

bspc rule -a firefox desktop=β€˜^2’

@hook.subscribe.client_new
def client_new(client):
    if client.name == 'Firefox':
        client.togroup('2')

http://docs.qtile.org/en/latest/manual/ref/hooks.html#libqtile.hook.subscribe.client_new

2 Likes

Doesn’t seem to work for me.

Not sure if it’s because I changed groups to

groups = [
Group(β€œ1”, label=β€œο„‘β€),
Group(β€œ2”, label=β€œο„‘β€),
Group(β€œ3”, label=β€œο„ β€),
Group(β€œ4”, label=β€œοƒ β€),
Group(β€œ5”, label=β€œο†Όβ€),
Group(β€œ6”, label=β€œο‡’β€),
Group(β€œ7”, label=β€œο€β€),
Group(β€œ8”, label=β€œο΅‚β€),
Group(β€œ9”, label=β€œο€β€),
]

It is still Group 2 regardless of the label - have you tried logging in / out?

Yes tried rebooting the system with no luck

Got it working thanks the help

how ?

This does work but case does matter with linux

if client.name == β€˜firefox’:
client.togroup(β€œ2”)

at the end of if statement i have the following logger code
else:
logger.warning(client)

which pipes the application name (client) to ./local/share/qtile/qtile.log

for the logger you will need to add the following import
from libqtile.log_utils import logger

1 Like