[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HowTo: Detect Laptop waking up from suspend from Emacs

From: Stefan Huchler
Subject: Re: HowTo: Detect Laptop waking up from suspend from Emacs
Date: Sat, 11 Feb 2017 15:54:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

address@hidden writes:

> Background:
> I run Emacs as my primary environment -- ie I do everything in Emacs
> on Linux.
> So when I open my laptop lid, my laptop wakes up from suspend and
> Emacs is where I left off.
> I'd like to set things up so emacs runs a set of actions when the
> laptop comes back from suspend -- typically, say 5 seconds after
> wake-up. Here, all actions are emacs functions.
> So Q:
> From Emacs --- perhaps an idle-timer, how do I detect when the laptop
> returns from suspend?
> -- 
> -- 

if you run the deamon you could maybe write in some external tools
somethnig like:

/usr/bin/emacsclient -e (wakeup-starter)

and then something like that in your config

   (sit-for 5)

You can hook that command in I dont know logind? or dbus? udev? as some
rule or maybe even systemd:


Hope that helps you.

Alternativly you could of course do a polling thing, and start that with

(while (t) (when (timestamp differs to much from last-time) (setq
last-time timestamp) (do-your-stuff) (sleep 5)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]