Search code examples
luastartupconfiguration-filesawesome-wm

Awesome WM restart flag


Does awesome window manager set some kind of flag during restart. I've some autostart commands in rc.lua and they are executed every time I restart the window manager.

How can I determine in the rc.lua if the file execution is done because of a restart?


Solution

  • Sorry, just want to comment @ploth 's answer...but not enough reputation. The given code is the one on the former wiki, and it didn't work for me. I use this one :

    function run_once(cmd)                 
     local findme = "ps x U $USER |grep '" .. cmd .. "' |wc -l"              
     awful.spawn.easy_async_with_shell( findme ,
       function(stdout,stderr,reason,exit_code) 
         if tonumber(stdout) <= 2 then
           awful.spawn( cmd )
         end
       end)
    end