erc-discuss
[Top][All Lists]
Advanced

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

Re: [Erc-discuss] resuming erc after sleep


From: Pascal Bourguignon
Subject: Re: [Erc-discuss] resuming erc after sleep
Date: Mon, 18 Sep 2006 12:17:37 +0200

Jesse Alama writes:
> I use ERC on a laptop, which I frequently put to sleep (by closing the
> lid).  It would be great if, upon waking the computer, ERC would
> automatically (attempt to) reconnect to whatever servers I was on, and
> to rejoin whatever channels I was on, and if it's unable to do that,
> say, because I'm no longer connected to a network, to indicate
> failure.  It would also be nice if whatever passwords I used last time
> I successfully connected to whatever IRC servers and channels I was on
> were cached so that I wouldn't have to re-enter them.
> 
> Any ideas for how to accomplish this?

When the system awakes, it must be running some scripts.  Add in them
a command such as:

# checks that the user YOURLOGIN is running an emacs:
ps axu|grep -q -s -e 'YOURLOGIN.*emacs' >/dev/null 2>&1 \
&& su - YOURLOGIN bash -c "emacsclient -e '(awake-emacs)'"


and in your ~/.emacs, define awake-emacs and start the server:

(server-start)

(defun awake-emacs ()
  (message "Yyaaaahhheeewww!  Ahhh!  Good morning, Vietnam!!!")
  ;; do whatever  you want to do in emacs when the computer awakes
  (erc "irc.frenode.org" 6667 "nick" "Name FamilyName" t)
  (erc-join-channel "#chan1")
  (erc-join-channel "#chan2")
  (erc-join-channel "#chan3")
  ;; ...
  )


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Debugging?  Klingons do not debug! Our software does not coddle the
weak."




reply via email to

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