Re: [dwm] Basic dwm usage question
greetings, As you can see I have the echo command sleep for 60 seconds. I was using 1 second, but found my load nearly doubles. My problem is when I i had this problem with using dwm on my Toshiba Libretto 100CT (cute and small laptop with 32M RAM and a 266mhz pentium). I investigated, and found that these things together (the shell, sed, etc) use quite a bit of system resources - especially the shell. I myself solved the problem by writing a small script interpreter with very small resource usage that just had enough power built in to do the necessary tasks (reading the relevant data from /proc and /sys, assembling and printing a status line); I would imagine this could be done with any other reasonably fast scripting language (especially a not marksweep GC-d one (python?)). The main thing is to avoid all the forking and piping. If you really want, I can give out my own interpreter, but it's shamefully dirty :) regards, Mate Nagy
Re: [dwm] Basic dwm usage question
of system resources - especially the shell. I myself solved the problem by writing a small script interpreter with very small resource usage that just had enough power built in to do the necessary tasks (reading I made a similar thing: a C program that opens a pipe to dwm and displays the time date, load and battery charge. If you (or anyone else) are/is intrested I can send a copy. Tom spaceinvader
Re: [dwm] Basic dwm usage question
On Thu, Jun 07, 2007 at 11:32:40AM +0100, Tom Menari wrote: of system resources - especially the shell. I myself solved the problem by writing a small script interpreter with very small resource usage that just had enough power built in to do the necessary tasks (reading I made a similar thing: a C program that opens a pipe to dwm and displays the time date, load and battery charge. If you (or anyone else) are/is intrested I can send a copy. Just post it here, I saw your paste some days ago at rafb or somewhere else, but feel free to post it here, so it gets archived and people can pick it up later - or just create a diri page. Regards, -- Anselm R. Garbe http://www.suckless.org/ GPG key: 0D73F361
Re: [dwm] Basic dwm usage question
On 6/7/07, Tom Menari [EMAIL PROTECTED] wrote: displays the time date, load and battery charge. If you (or anyone else) are/is intrested I can send a copy. iirc it wasn't huge so you can post it here to make it available for those who search the mail archive it's a useful tool for dwm and fits well into suckless philosophy
[dwm] Basic dwm usage question
Hello list, I've recently switched over to dwm full time. I run it on OpenBSD 4.1 -release and couldn't be happier. I just have a simple question about how dwm quits. I use the following command in my .xinitrc to start dwm: while true do echo [ B: `/usr/sbin/apm -l`% T: `/sbin/sysctl hw.sensors.aps0.temp0 \ | sed 's/hw.sensors.aps0.temp0=//g' | sed 's/.00//g' | awk '{print \ $1}'`C ] [ `uptime | perl -e ' =~ \ /\s+([0-9.]+),\s+([0-9.]+),\s+([0-9.]+)/;print qq[$1, $2, $3];'` ] [ \ `date +%m/%d/%y %H:%M` ] sleep 60 done | dwm As you can see I have the echo command sleep for 60 seconds. I was using 1 second, but found my load nearly doubles. My problem is when I run Alt + Shift + q to quit dwm I find X hangs for awhile before existing. I assume it hangs for as long as the time is left for the sleep command, depending where it is when i quit dwm. I was wondering if there is away to kill sleep as soon as I quit dwm? Thanks for the help as I imagine it's not dwm specific. -- James Turner BSD Group Consulting http://www.bsdgroup.org
Re: [dwm] Basic dwm usage question
That's also a question I wanted to ask :) Even though I didn't notice any load increase when using 1 second (I'm just displaying the date), I didn't like the idea of having it to refresh so often needlessly. So I increased to 60 seconds, but ran into the problem you mention, so I set it to 5 seconds because of that.
Re: [dwm] Basic dwm usage question
On Wed, Jun 06, 2007 at 11:28:52PM +0200, Anydot wrote: On (06/06/07 17:03), James Turner wrote: As you can see I have the echo command sleep for 60 seconds. I was using 1 second, but found my load nearly doubles. My problem is when I run Alt + Shift + q to quit dwm I find X hangs for awhile before existing. I assume it hangs for as long as the time is left for the sleep command, depending where it is when i quit dwm. I was wondering if there is away to kill sleep as soon as I quit dwm? Thanks for the help as I imagine it's not dwm specific. You can look on snippet of my ~/.Xsession file: http://na.srck.net/dwm/Xsession-snippet it updates datetime every second, but load and diskcpu temperature only each 15 seconds. Also there is outer BIG loop so I am able to reload dwm (via dwm quit). To end the session I can use c-a-backspace (- Xserver quits and all the program it was running too). -- Premysl Anydot Hruby http://na.srck.net Thanks for everyone hints. I'd rather not have to run c-a-backspace (which I do now). I'd prefer dwm to quit and the xsession to terminate normally. I did find this posting: http://www.suckless.org/pipermail/dwm/2006-July/19.html and am following it now. I believe it to be the answer to my problem. -- James Turner BSD Group Consulting http://www.bsdgroup.org
Re: [dwm] Basic dwm usage question
Alright, after browsing the archive I was able to whip up a working solution. In my .xinitrc I have: [ -p .dwm-status ] || mkfifo $HOME/.dwm-status $HOME/.dwm.in exec dwm $HOME/.dwm-status In .dmw.in I have: #!/bin/sh while true do echo [ B: `/usr/sbin/apm -l`% T: `/sbin/sysctl hw.sensors.aps0.temp0 \ | sed 's/hw.sensors.aps0.temp0=//g' | sed 's/.00//g' | awk '{print \ $1}'`C ] [ `uptime | perl -e ' =~ \ /\s+([0-9.]+),\s+([0-9.]+),\s+([0-9.]+)/;print qq[$1, $2, $3];'` ] [ \ `date +%m/%d/%y %H:%M` ] ~/.dwm-status sleep 60 done I'm now able to use alt+shift+q and dwm and the xsession exits like I would expect! -- James Turner BSD Group Consulting http://www.bsdgroup.org