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? Robert 2010/5/27 Andreas Amann <am...@physik.tu-berlin.de>: > On Thu, May 27, 2010 at 09:58:55AM +0100, Anselm R Garbe wrote: >> On 27 May 2010 09:54, <orsch...@googlemail.com> wrote: >> > Oh dear how bad has my english to be since nobody is understanding me >> > right. *g* >> > >> > Well second approach. Currently I'm using the following code to >> > generate my statusbar: >> > >> > #set statusbar >> > while true >> > do >> > 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 '[]') | $(date +"%a, %b %d %R")" >> > else >> > xsetroot -name "Vol. $(amixer get Master | tail -1 | awk '{ >> > print $5}' | tr -d '[]') | $(date +"%a, %b %d %R")" >> > fi >> > sleep 1s >> > done & >> > >> > The point is now that I want to extend exactly this statusbar to >> > display the layout I'm using, so either 'de' or 'pl'. >> > >> > So no, I don't want to get rid of it. >> > >> > Please say you understand what I intend. :) >> >> Sorry I didn't read the full thread. >> >> I guess >> >> setxkbmap -print >> >> might provide you the info you need to grep to decide if its de or pl. >> > > Just to clarify, Robert uses a setup equivalent to > setxkbmap -option "grp:alt_shift_toggle" "de,pl" > > This means that he toggles between de and pl layout by pressing alt+shift > simultaneously. In this case > setxkbmap -print > gives the same output > > xkb_keymap { > xkb_keycodes { include "evdev+aliases(qwertz)" }; > xkb_types { include "complete" }; > xkb_compat { include "complete" }; > xkb_symbols { include > "pc+de+pl:2+inet(evdev)+group(alt_shift_toggle)" }; > xkb_geometry { include "pc(pc104)" }; > }; > > independent of which layout is active. > > Btw, the thread started with a valid bug report for dwm in this setup, which > could be fixed via > diff --git a/dwm.c b/dwm.c > --- a/dwm.c > +++ b/dwm.c > @@ -43,7 +43,7 @@ > /* macros */ > #define D if(1) > #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) > -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) > +#define CLEANMASK(mask) (mask & > (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) > #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= > (RY) && (Y) < (RY) + (RH)) > #define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) > #define LENGTH(X) (sizeof X / sizeof X[0]) > > not sure if you want to apply this to mainline dwm? > > > Andreas > > >