You are not logged in.
Hey all,
I'm trying to get a pure bash statusbar in DWM. All is working fine except for the date function. Whenever I run that, I get an error:
fork: not enough memoryIndeed my RAM goes up like a rocket and obviously that's not what I want. Here's the snippet of my dwm_status script:
date(){
date="$(date "+%H:%M")"
echo -e "\x02É \x01$date"
}
....
# Pipe to status bar
while true ; do
xsetroot -name "$(mpd) $(cpu) $(video) $(mem) $(disk) $(net) $(vol) $(bat) $(date)"
sleep 1s
done &I run the script through .xinitrc, with bash $HOME/.bin/dwm_status. I searched a bit on Google but this was more about servers and such. I'd like some Arch specific advice on this if possible, so hence my asking here. Looking forward to your reply, as I am sure this is not a hard issue to resolve!
Unia
Last edited by Unia (2012-04-14 21:18:53)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Try this and see if it still happens:
dte(){
dte="$(date +"%H:%M)"
echo -e "\x02É \x01$dte"
}and change xsetroot -name "$(dte)"
Offline
Hm, that seems to work. Though if I'm not mistaken (and Bash neither
) you forgot an " in your function. Anyway, the only difference I see is the different name of the function and that in my function, the + is inside the quotes whereas in yours it's not.
What difference does that make?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
Yeah what he said ![]()
But yeah, you're right, I forgot the ", but you figured that much out.
Offline
Ah oke I see. Thanks guys!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline