I would like to launch one program whenever I change of layout in one screen, or when I change of screen tag.
Is there a signal to which I could connect ?
Thanks for your help.
Regards
I would like to launch one program whenever I change of layout in one screen, or when I change of screen tag.
Is there a signal to which I could connect ?
Thanks for your help.
Regards
Digging into the awesome wiki I managed to get what I wanted :
tag.connect_signal("property::layout",
function(t)
print("Layout of tag changed")
end)
This (upper) launches a signal as soon as the current's tag layout is changed.
client.connect_signal("manage",
function(c)
if c:tags()[1].name == awful.tag.selected(1).name then
print("New client : " .. c.name)
end
end)
This launches a signal as soon as a new client appears in the current tag.
client.connect_signal("focus", function(c)
if #c:tags()[1]:clients() > 1 then
print(c.name)
end
end)
This launches a signal as soon as the focus is changed. This is only relevant for tags with more than one client.
screen[1]:connect_signal("tag::history::update",
function()
print(awful.tag.selected(1).name)
end)
Last, this launches a signal as soons as I switch of tag, assuming only one screen.
The reason for me to do all that is that I want the screen brightness to be modified as soon as the screen appearance changes, which happens either by changing of layout, or changing of focus, or of tag, or creating a new client.
Switching abruptly of tags, from a dark xterm to a bright firefox (as an example), usually hurts my sensitive eyes.
Sorry for my question not being initially very clear, I do not know the awesome vocabulary very well.
Regards