You are not logged in.
Hi All,
Last night I made the jump from 2 years of xmonad to dwm, after having some annoying haskell update issues, and wanting to try out a WM written in a language I know. Everything was set up fine, explored the patches, fell in love with flextile, made everything familiar, and so on. What's been happening, though, is that the statusbar loop that updates the dwm status keeps on not working after a period of time. It's pretty annoying, since the time stops, and its pretty much a game-stopper. I would really hate to kill more time now, with exams coming up, on setting up a different wm, and checking my phone for time is too distracting.
I dont use a login manager, everything is started from my one and only tty. My macbook is pretty responsive, especially with the low-resource usage of dwm. The reason I have a separate script to echo the contents of the statusbar is to allow me to mess with the bar's contents and see imediate feedback.
Honestly, I've looked everywhere, and couldn't find anything to solve this. Also, it sucks dwm cant take a status bar from stdin... ![]()
Here is the relevant line from my .xinitrc
while true; do xsetroot -name "`dwmstatus`"; sleep 1s; done &
startdwmhere is the dwmstatus script.
#!/bin/sh
sep="|"
essid=`iwconfig wlan0 | awk -F '"' '/ESSID/ {print $2}'`
stngth=`iwconfig wlan0 | awk -F '=' '/Quality/ {print $2}' | cut -d '/' -f 1`
bars=`expr $stngth / 10`
case $bars in
0)
bar='[-------]'
;;
1)
bar='[#------]'
;;
2)
bar='[##-----]'
;;
3)
bar='[###----]'
;;
4)
bar='[####---]'
;;
5)
bar='[#####--]'
;;
6)
bar='[######-]'
;;
7)
bar='[#######]'
;;
*)
bar='[--!!!--]'
;;
esac
netstr="N: $essid $bar $sep"
volstr="V: $(amixer get PCM | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2 }}' | head -n 1) $sep"
if acpi -a | grep off-line > /dev/null; then
batstr="Bat. $( acpi -b | awk '{ print $4 " " $5 }' | tr -d ',' ) $sep"
else
batstr=""
fi
datestr="$(date +'%a, %b %d %R')"
echo "$batstr $netstr $volstr $datestr"
sleep 1sHere is the startdwm script
#!/bin/sh
while true; do
case $1 in
-q)
# not log
dwm >/dev/null 2>&1
;;
*)
# Log
dwm 2> ~/.dwm.log
;;
esac
doneAny help would be much appreciated.
![]()
EDIT: Forgot to mention when I Mod+Shift+Q close dwm, it restarts automatically with an updated status, but the bar is still unresponsive (i.e. time and volume dont change). Currently, I'm trying a longer update between iterations. We'll see if this takes us anywhere...
Last edited by meatcar (2011-04-05 04:26:15)
Offline
This isn't a solution to your problem, but have you considered piping conky into your statusbar? It seems to me it would do everything you are wanting to do with your separate script, and it would probably use about the same resources. I haven't had any trouble with it to date.
I laugh, yet the joke is on me
Offline
Sadly, one can't pipe the status command into dwm anymore. While i havent tried conky, I would still have to use xsetroot to display the output, and I would imagine a similar issue would occur.
Also, setting a longer wait time is not an option. At 4 seconds between iterations, my time still stops. Tomorrow, i'll try having a less complicated status bar... maybe that would work..
Offline
Nothing leaps out at me, but you might try starting dwm like so:
while true; do path/to/dwmstatus; sleep 1s; done &
startdwmAnd including in your script:
xsetroot -name "$batstr $netstr $volstr $datestr"(Note - you now only have one sleep call - in your start script).
Offline
I use Statnot and start it like:
statnot ~/.config/statnot/config.py &
while true; do
dwm > /dev/null 2>&1
doneMy statnot/config and statusline.sh are in my sig. It works great -- plus you get statusbar notifications if you so desire. I'm not sure if this is what you were looking for, but I haven't had any problems with it. I've got a pretty extensive status bar script, too.
Scott
Offline
Oh man. Breakthrough. I tried firecat53's advice, but the status bar was still becoming unresponsive after a while. I figured, it's not xsetroot's problem, its dwm's, since my script is responsive, and xsetroot is responsive, so some loop in dwm stops getting the data from xsetroot. After recompiling dwm without any patches, the statusbar has been fully responsive for the past 20 mins, which is more than anything i've seen so far. Later tonight, i will scientifically deduce which patch is responsible for this mahem, and report back.
Thanks for the statnot advice. I've seen it before, but I was too inconvenienced to set it up. It was remarkably easy to do though.
Also, jasonwryan, thanks for spotting the reduntant sleep call.. totally slipped my mind.
Offline
Mystery resolved. The culprit has been identified as the warp patch. Honestly, I don't know how, or why, but if I don't patch with warp, everything works. ![]()
Thanks for everyone's help. ![]()
Offline