Re: [dwm] A question about drawbar()

2008-07-11 Thread markus schnalke
Jason Thigpen [EMAIL PROTECTED] wrote:
 
 while true
 do
 echo `date +%m/%d %H%M`
 sleep 60
 done | dwm
 
 
 (you only need to pole date once a minute for as accurate as you are  
 getting)

but then you probably have to wait one minute when you want to
shutdown (Alt-q) dwm.

(At least it was like this in earlier releases - I dont know about
the current ones.)


meillo


signature.asc
Description: Digital signature


Re: [dwm] Status text clock patch

2008-07-11 Thread Donald Chai

Any help would be appreciated, and also how could i do the same
without using threads?



This seems to work fine for me...

--- a/dwm.c Thu Jul 03 17:05:56 2008 +0100
+++ b/dwm.c Fri Jul 11 00:26:08 2008 -0700
@@ -1313,11 +1313,28 @@ setmfact(const Arg *arg) {
arrange();
 }

+#include time.h
+
+void
+updatestatus(int signum) {
+time_t t = time(0);
+struct tm *ctm = localtime(t);
+
+strftime(stext, sizeof(stext), %T, ctm);
+drawbar();
+
+signal(SIGALRM, updatestatus);
+alarm(1);
+}
+
 void
 setup(void) {
uint i;
int w;
XSetWindowAttributes wa;
+
+   signal(SIGALRM, updatestatus);
+   alarm(1);

/* init screen */
screen = DefaultScreen(dpy);




Re: [dwm] Status text clock patch

2008-07-11 Thread John Mpanos
2008/7/11 Donald Chai [EMAIL PROTECTED]:
 Any help would be appreciated, and also how could i do the same
 without using threads?


 This seems to work fine for me...

 --- a/dwm.c Thu Jul 03 17:05:56 2008 +0100
 +++ b/dwm.c Fri Jul 11 00:26:08 2008 -0700
 @@ -1313,11 +1313,28 @@ setmfact(const Arg *arg) {
arrange();
  }

 +#include time.h
 +
 +void
 +updatestatus(int signum) {
 +time_t t = time(0);
 +struct tm *ctm = localtime(t);
 +
 +strftime(stext, sizeof(stext), %T, ctm);
 +drawbar();
 +
 +signal(SIGALRM, updatestatus);
 +alarm(1);
 +}
 +
  void
  setup(void) {
uint i;
int w;
XSetWindowAttributes wa;
 +
 +   signal(SIGALRM, updatestatus);
 +   alarm(1);

/* init screen */
screen = DefaultScreen(dpy);



Much thanks for the code, my mind was stuck on threads, but that is
much simpler.
I am on an 8 yeard old T-23, and dwm really makes it rock. Its as if
it was designed for the Thinkpad considering that the trackpoint keeps
your hands right on the right keys. Using dwm i feel liberated from
the pointer device :P


-- 
Dum inter homines sumus, colamus humanitatem.



[dwm] for reference, Xinerama

2008-07-11 Thread Anselm R. Garbe
Hi there,

just for the tracker, I recently agreed to slightly extend dwm's
and dmenu's Xinerama support to query the mouse pointer for the
default Xinerama screen to use, and using 0 instead as fallback
if there is no pointer.

Thus xidx will be removed again.

But with this mechanism it is possible to change the dwm main
screen without restarting X, just restart dwm.

Kind regards,
-- 
 Anselm R. Garbe  http://www.suckless.org/  GPG key: 0D73F361