0
votes

I have following idea:

I have a wallpaper in 2 version. One original and second a bit blurry. I want to change the wallpaper from original when first window/program opens on the screen. Once the last window/program is closed change the wallpaper back. Also when I change between tags I want to check if any window/program is open or not and then adjust the wallpaper.

How can I do that?

P.S. I use nitrogen to set wallpaper

AwesomeWM client created/removed callback

1

1 Answers

0
votes

I found a way to set the wallpaper depending on the visible clients, but I have no idea how your Nitrogen calls look like. Just replace the naughty.notify lines with your Nitrogen invocations.

Somewhere in your rc.lua, you should find something like this:

awful.screen.connect_for_each_screen(function(s)

Add the following to that function

tag.connect_signal("property::selected", function(t)
  if #s.clients > 0 then
    naughty.notify({text = "set blurry wallpaper", timeout = 1})
  else
    naughty.notify({text = "set original wallpaper", timeout = 1})
  end
end
)

table.getn is deprecated but this is the solution for older lua versions:

tag.connect_signal("property::selected", function(t)
  if table.getn(s.clients) > 0 then
    naughty.notify({text = "set blurry wallpaper", timeout = 1})
  else
    naughty.notify({text = "set original wallpaper", timeout = 1})
  end
end
)