Re: [dwm] C-version of dwm status (no xsetroot needed)
On Tue 16 Dec 2008 - 04:08PM, Donald Chai wrote: use his status program. His intent is that anyone who can't figure out xsetroot can use 4 X11 procedures from C. actually my intent was to get away from bash scripts/whatnot and having to use so many different programs to generate a status line. Anyways, here's my finished dwm status code. It doesnt use any external calls now, so it uses much less memory than the multiple subshell bash scripts i used before. I get the cpu/wireless/battery info directly from /proc in C, so there is no need to fork/pipe anything. Since it fully supports the libnotify specs, it also has the benefit of catching all notifications (no more annoying popups, and keeps notification-daemon from spawning, so even more processes/memory saved). Finally, just for kicks I added in an mpd songchange function to give me a quick artist - title message. There are #ifdef's for all the fancy stuff, so if anyone wants to test it out just modify the Makefile to suit. Jeremy dwmstatus.tar.bz2 Description: Binary data
Re: [dwm] C-version of dwm status (no xsetroot needed)
Jeremy Jay dinkuma...@gmail.com writes: Anyways, here's my finished dwm status code. Nice. I've written something very similar, but mine relies more on the shell and having to use lots of programs. I wanted to create an extensible tool that you could use as the foundation of a shell script that chains lots of other things together. I'm glad to see someone else on the list is using dbus, even if just a little. http://woozle.org/~neale/gitweb.cgi?p=status;a=tree Neale
Re: [dwm] C-version of dwm status (no xsetroot needed)
On Tue, 16 Dec 2008 12:38:17 -0500 Jeremy Jay dinkuma...@gmail.com wrote: Here's some simple C code I wrote to handle setting the xprop without using xsetroot. At the moment it just spawns the same shell scripts I used before, but it may be useful for those having issues with xsetroot... If anyone is interested, this is the beginings of a libnotify-aware status script :) Jeremy Hi, IMHO it is too complicated. Moreover that's exactly the solution I proposed some days ago but mine was simplier and within dwm.c. This will not satisfy Donald Chai : Donald Chai wrote in a previous post : My status text includes the weather (updated only every 15min to avoid hammering their servers), and the time (updated once a minute, on the minute, to reduce my wakeups-per-second in PowerTOP). For me, this SIGALRM and spawn2 would require that I store some temporary data somewhere between invocations. Anselm, if you don't like popen, then take Jeremy's runScript function. Neale Pickett, where are you in your investigations ? Could be X the problem ? -- Kind regards, Guillaume Quintin.
Re: [dwm] C-version of dwm status (no xsetroot needed)
Guillaume Quintin coincoin1...@gmail.com writes: Neale Pickett, where are you in your investigations ? Could be X the problem ? I stopped my investigation when Anselm accepted the xprop patch. Now status scripts will be just another background process with an X connection (like xterm), and there should be no need to worry about open FDs or whatever. Guillaume, I was under the impression that your specific problem had to do with something in your OS's X package. I think you're going to find the next dwm release makes the problem go away (after you convert your status script). Anselm, if you don't like popen, then take Jeremy's runScript function. This little bourne shell script may give you the behavior you desire: #! /bin/sh while true; do sleep 2 xsetroot -name $(myscript) || exit 0 done Neale