You are not logged in.
Pages: 1
I have tried
https://wiki.archlinux.org/index.php/Dw … _statusbar
and it does not work.
I have tried ~/.xinitrc and ~/.Xclients, and it just does not work...
I am using gdm as display manager.
These are few lines which I added.
while true; do
xsetroot -name "$( date +"%F %R" )"
sleep 1m # Update time every minute
done &
exec dwm
When I use
xsetroot -name "$( date +"%F %R" )"
in terminal status bar is updated.
Can someone help?
Thanks.
Last edited by LordOfInsomnia (2011-11-12 15:13:38)
Offline
See the wiki for GDM and xprofile. Maybe that will help.
Offline
I did find anything.
Which display manager do you use?
Offline
When i execute code
while true; do
xsetroot -name "$( date +"%F %R" )"
sleep 1m # Update time every minute
done
from terminal, status bar is updated...
As soon as I terminate terminal, update of status bar is over. This part I understand.
Last edited by LordOfInsomnia (2011-11-09 20:58:31)
Offline
I have no idea how GDM works, but I would hazard a guess that your fix will involve working around that...
There is a section in the wiki on creating your own .desktop file, have you tried that?
# edit: also, please use \[code\] tags - it makes it easier to read what you are posting
Last edited by jasonwryan (2011-11-09 20:51:24)
Offline
@Jason I have fixed my posts
I have tried
http://www.guldmyr.com/blog/dwm-start-u … n-manager/
/usr/share/xsessions/dwm.desktop
[Desktop Entry]
Encoding=UTF-8
Name=dwm
Comment=This session starts dwm
Exec=/usr/local/bin/dwm-start
Type=Application
/usr/local/bin/dwm-start
#!/bin/sh
while true; do
xsetroot -name "$( date +"%F %R" )"
sleep 1m # Update time every minute
done
Offline
Short of recommending that, if you really want to run dwm, you uninstall GDM - then all I've got is:
i) don't use the name dwm in the desktop file: try dwm-los or something so that GDM definitely picks up the correct file
ii) execute dwm from the start script
Offline
I dont use GDM any more, I have switched to CDM. Still I cannot update status bar from ~/.xinitrc.
I have made bash script which updates status bar for me...
What am I doing wrong?
Offline
Paste your .xinitrc and the statusbar script (and your dwm-start script if you use one).
Offline
~/.xinitrc
#!/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
while true; do
xsetroot -name "$( date +"%F %R" )"
sleep 1m # Update time every minute
done &
exec dwm
I think
exec dwm
is not needed here.
updateStatusBar script
#while true; do
# pack=`pacman -Qu | wc -l`
# sleep 1
#done&
#this does not work
while true; do
pack=`pacman -Qu | wc -l`
mem2=`grep MemFree /proc/meminfo | awk '{ print $2 }'`;
mem=$(( $mem2/1024 ));
CLK=$( date +'%a %b %d %R:%S %Z' )
xsetroot -name "|| $pack | $mem MB | $CLK ||";
sleep 1;
done&
I wanted to have two loops one with sleep 1h (for packeges), and one with sleep 1s (for time and memory), but i could not make it work.
I have also tried http://dwm.suckless.org/dwmstatus/
after
make clean install
i get this
fopen: No such file or directory
Same error is when I am trying to start dwmstatus from compiled dir, file exists, but wont start...
This is new issue...
Offline
A couple of things:
if you are using cdm, then having that stuff in your .xinitrc won't be much help - put it in a start script
set the xroot window props once, either in your dwm-start script or your dwm status bar script - otherwise the conflict will cause you grief
just get the basic loop working before trying anything more complex
in your script, try using something like:
dte(){
dte="$(date "+%I:%M")"
echo "$dte"
}
xsetroot -name "$(dte)"
Offline
Thank you jasonwryan!
this is my .xinitrc
#!/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 dwm
But 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?
Last edited by LordOfInsomnia (2011-11-12 15:15:15)
Offline
Pages: 1