View Single Post
Old 10-23-2013, 10:13 AM   #43
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Quote:
Originally Posted by twobob View Post
I believe there was a default keybinding CMD + R (or something) that causes awesome to reload it's configuration while running...

Another gem to be dug up perhaps one day. *makes notes*
It's not default keybinding, it should be set explicitly (to invoke function awesome.restart).

I came to something different but also useful for this case (using overrided rc.lua):
Code:
package.path = "/var/tmp/root/.config/awesome/?.lua;" .. package.path
dofile("/etc/xdg/awesome/rc.lua")

local lipcH, errNum, errMsg = lipc.init("com.lab126.winmgr.extra")
if not lipcH then
  log ("!!!!!!!!!!!failed to init lipc " .. tostring(errNum) .. ", " .. errMsg)
else
  lipcH:register_string_property("restart", "w").listener = awesome.restart
  awesome.add_signal("exit", lipcH:close)
end
Then just:
Code:
$ lipc-set-prop com.lab126.winmgr.extra restart now
Instead "now" any string value could be used.

Unfortunately, every restart creates additional /bin/sh -c awesome process hanging around. And according to awesome sources, it's by design:
Spoiler:
Code:
void
awesome_restart(void)
{
    awesome_atexit(true);
    a_exec(globalconf.argv);
}
Code:
void
a_exec(const char *cmd)
{
    static const char *shell = NULL;

    if(!shell && !(shell = getenv("SHELL")))
        shell = "/bin/sh";

    execl(shell, shell, "-c", cmd, NULL);
}

Last edited by eureka; 10-23-2013 at 10:16 AM.
eureka is offline   Reply With Quote