You are not logged in.
Pages: 1
This is my .xinitrc
Thank you jasonwryan!
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
#exec gnome-session
#exec startkde
#exec startxfce4
# ...or the Window Manager of your choice
packeges()
{
packeges="`pacman -Qu | wc -l`"
if [ $packeges -eq 0 ]; then
echo ""
else
echo " $packeges |"
fi
}
mydate()
{
datePart=$( date +'%d.%m.%Y' )
echo " $datePart |"
}
mytime()
{
hh=$( date +'%H')
mm=$( date +'%M')
ss=$( date +'%S')
if (( ( "$ss" % 2 ) == "0" )); then
timePart=( $hh:$mm:$ss )
else
timePart=( $hh" "$mm" "$ss )
fi
echo " $timePart |"
}
mymem2()
{
mem2=`grep MemFree /proc/meminfo | awk '{ print $2 }'`
mymem2=$(( $mem2/1024 ));
echo " $mymem2 MB |"
}
while true; do
xsetroot -name "||$(packeges)$(mymem2)$(mydate)$(mytime)||";
sleep 1
done &
exec dwmBut clock skips one second from time to time.
I think this is because of function "packeges", because lasts longer the one second.
How can i have two loops with different timings?
Offline
Pages: 1