ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] Persistent Clock


From: Peter Danenberg
Subject: [RP] Persistent Clock
Date: Tue, 22 Feb 2005 16:49:48 -0600
User-agent: Mutt/1.4.2.1i

     What  I miss about FVWM is my sticky XClock, which per-
sisted in the upper-right corner; to that end, I whipped  up
a hackish C proggy to echo the time at one second intervals:


     #include <stdlib.h>
     #include <signal.h>
     #include <sys/wait.h>
     #include <unistd.h>

     #define COMMAND "ratpoison -c \"echo $(date)\""
     #define SLEEP 1

     int main() {
       int i;
       while (!(WIFSIGNALED(i = system(COMMAND)) &&
                (WTERMSIG(i) == SIGINT || WTERMSIG(i) == SIGQUIT)))
         sleep(SLEEP);
       return EXIT_SUCCESS;
     }


Problem is, of course, it invokes a process every second; is
there  a more effective way to get a persistent clock, or is
it time to hack the source?


--
Peter Danenberg                                           .
wikisophia.org                                           ..:




reply via email to

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