I tried your code but this always just displays 'de'. There is no change while toggling between the layouts.
2010/5/27 pascal <lepasca...@gmail.com>: > Le Thu, 27 May 2010 15:25:32 +0200 > orsch...@googlemail.com a écrit: > >> Hello Andreas, >> >> your solution is almost working. The only thing that doesn't fit is >> the length of the output. de/pl should only by two letters but in the >> output there are a plenty of blanks before. I assume this happens >> because the eight digits were substituted by only two letters? >> >> Better understanding: >> >> xxxxxxde where 'x' stands for a blank >> >> Could that be corrected to use not so much space in the bar? >> >> 2010/5/27 Andreas Amann <am...@physik.tu-berlin.de>: >> > On Thu, May 27, 2010 at 12:49:59PM +0200, orsch...@googlemail.com wrote: >> >> Thanks for the hint Andreas. xset -q shows a difference between both >> >> values. I tried to implement it into my statusbar but as I'm not >> >> familiar with bash scripting it doesn't work. This is my trial: >> >> >> >> #set statusbar >> >> while true >> >> do >> >> #define keyboard layout >> >> if [ "$(xset -q | grep "LED mask:" | awk '{ print $10 }')" == >> >> "00000000" ] ; then >> >> kb = "de" >> >> else >> >> kb = "pl" >> >> fi >> >> if acpi -a | grep off-line > /dev/null; then >> >> xsetroot -name "Bat. $( acpi -b | awk '{ print $4 " " $5 }' | >> >> tr -d ',' ) | Vol. $(amixer get Master | tail -1 | awk '{ print $5}' | >> >> tr -d '[]') | $kb | $(date +"%a, %b %d %R")" >> >> else >> >> xsetroot -name "Vol. $(amixer get Master | tail -1 | awk '{ >> >> print $5}' | tr -d '[]') | $kb | $(date +"%a, %b %d %R")" >> >> fi >> >> sleep 1s >> >> done & >> >> >> >> Could you help me out please? >> > >> > The following works for me: >> > while xsetroot -name "$(xset -q|sed -ne "2 s/^.*00000000/uk/ p; 2 >> > s/^....*/de/ p") | $(date +"%a, %b %d %Y | %H:%M")" >> > do >> > sleep 2s >> > done & >> > >> > Andreas >> > >> > >> >> > > You can use this : > while xsetroot -name "$(setxkbmap -print | grep xkb_symbols | awk > '{print $4}' | awk -F"+" '{print $2}') | $(date +"%a, %b %d %Y | %H:%M")" > do sleep 2s > done & > > > > >