I wanted to create an awesome session used to restore all the clients of
the previous awesome initialization.
To do that I define an exit event on the awesome object and store all the
client in a file i ~/.config/awesome/sessions
awesome.add_signal("exit", function ()
for i,v in pairs(spawn_tab) do print("exit: ",i,v) end
file = io.open("~/.config/awesome/sessions","w")
for i,c in pairs(client.get()) do
file:write(c.name.."\n")
print(c.name)
c:kill()
end
file:close()
end)
The problem is that in the client object there is no binary_name
property that I need to execute for next start of awesome.
So, another way was to catch the initiated event and use a dict to store
the active cient with id as key and bin_name as value.
spawn_tab = {}
awesome.add_signal("spawn::initiated", function (tab)
-- for i,v in pairs(tab) do print("init",i,v) end
spawn_tab[tab.id] = tab.binary_name
print("stored: ", tab.id, spawn_tab[tab.id])
end)
How can I catch the event when a client is closing to update spawn_tab??
Or There is a way to know the list of binary_name of the client directly
using
only exit event of awesome??
Thanks,
Filippo