Firstly: you are not closing one of the three nested loops.
Secondly: You don't need that many loops, just one infinite loop
should be fine. Also, that "&" makes it so it both runs dwm AND
continues the loop, this is a good thing.
Thirdly:: calling dwm is not a good idea inside any of the loops
Fourthly: It's not crazy important (I think) but use exec, and
/usr/bin should be in your path so you don't need the /usr/bin (again,
not important)
Fifthly: If you want the script to show a relatively accurate time,
use a 2s sleep as opposed to a 55s sleep. Mostly so your clock stays
up to date (although consume MANY more resources)

Likely you want:
while true
        do
            xsetroot -name "$(date +"%a, %b %d %Y | %H:%M")"
            sleep 2s
        done &
exec dwm

If you want it to have a clock AND show harddrive space in use use:
while true
        do
            xsetroot -name "$(date +"%a, %b %d %Y | %H:%M") $(du -h /)"
            sleep 2s
        done &
exec dwm


On 23 March 2011 16:08, Le Tian <[email protected]> wrote:
> ok, now I tried to make .xinitrc file in my home/me dir, and added these
> lines:
>
> while true
> do
>
>     while true
>     do
>
>         while true
>         do
>             xsetroot -name "$(date +"%a, %b %d %Y | %H:%M")"
>             sleep 55s
>         done &
>
>         /usr/bin/dwm
>     done
>
>
> but it doesn't work. When I start dwm, I get clean screen without anything,
> so I deleted it.
> I'm sorry, but I not that sophisticated in proper scripting, can someone
> tell me how to do it properly(I'm running SUSE 11.4). Should I create
> .xinitrc or should I make .dwmrc or else?
>
>

Reply via email to