Hi,

On 13.11.2011 17:20, Sqoox85 wrote:
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.

That is in c.command, but a number of apps don't set that property. E.g. urxvt does set it.

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??

awesome.add_signal("manage", function(c)
  c:add_signal("unmanage", function()
    print(c.name .. " was closed")
  end)
end)

Or There is a way to know the list of binary_name of the client directly
using
only exit event of awesome??

See above, c.command.


What you seem to look for is called a session manager.

http://www.xfree86.org/current/xsm.1.html

No idea how common client support for this or how to integrate this with awesome. I guess you want to run xsm's shutdown instead of awesome's and need some magic on top of that.

Good luck,
Uli


--
To unsubscribe, send mail to [email protected].

Reply via email to