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

Reply via email to