Hi Sebastian,

I can propose a way to automatically suspend/unsuspend application
when it loses/regains its focus.

Please take a look at this snippet.

local signal = require("posix.signal")
....
awful.rules.rules = {
    { rule = { class = "Firefox" },
      callback = function(c)
         c:connect_signal("unfocus", function () signal.kill(c.pid,
signal.SIGSTOP); end);
         c:connect_signal("focus", function () signal.kill(c.pid,
signal.SIGCONT); end);
    end}
    }

I'm not sure that automatic process suspension will play nicely with
all applications, but you could try and see for yourself.

On 7/17/16, Sebastian Fischmeister <[email protected]> wrote:
> Hi,
>
> There are a lot of apps who consume cpu time in the background while I'm
> not using them. Does anyone know a good way to incorporate automatic
> process suspension upon unfocus to awesome?
>
> For example, I have gmail open in a dedicated browser (e.g., I only use
> firefox for this). When I unfocus firefox, awesome should send SIGSTOP
> to the firefox process. When I focus on firefox again, awesome should
> send a SIGCONT.
>
> Candidates for this behaviour includes browsers in general, but also
> virtualbox, and even some messenger apps (I get the notification on my
> cell phone anyways).
>
> Any ideas?
>
>   Sebastian
>
> --
> To unsubscribe, send mail to [email protected].
>


-- 
Kind Regards,
Aleksey

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

Reply via email to