Re: [dev] [dwm] can't toggle tags with mouse

From: Andreas Amann <amann_AT_physik.tu-berlin.de>
Date: Thu, 27 May 2010 12:17:06 +0200

On Thu, May 27, 2010 at 09:58:55AM +0100, Anselm R Garbe wrote:
> On 27 May 2010 09:54, <orschiro_AT_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
Received on Thu May 27 2010 - 10:17:06 UTC

This archive was generated by hypermail 2.2.0 : Thu May 27 2010 - 10:24:02 UTC