0

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

deb2014
  • 89
  • 7
  • What do you mean with "change of layout in one screen"? Do mean layout as in "tile", "floating", ...? And screen tag as in "switch to tag 2", "additionally select tag 3", ...? – Uli Schlachter Jan 24 '17 at 08:45

1 Answers1

0

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

deb2014
  • 89
  • 7