mirror of https://github.com/0intro/wmii
Added LeftBarClick and RightBarClick events. Fixed bar initialization (this is ugly)
This commit is contained in:
parent
645f3102df
commit
ec4dc189f4
|
@ -75,7 +75,14 @@ handle_buttonrelease(XEvent *e)
|
|||
if(ev->window == barwin) {
|
||||
for(b=lbar; b; b=b->next)
|
||||
if(ispointinrect(ev->x, ev->y, &b->bar->rect)) {
|
||||
snprintf(buf, sizeof(buf), "BarClick %s %d\n",
|
||||
snprintf(buf, sizeof(buf), "LeftBarClick %s %d\n",
|
||||
b->name, ev->button);
|
||||
write_event(buf);
|
||||
return;
|
||||
}
|
||||
for(b=rbar; b; b=b->next)
|
||||
if(ispointinrect(ev->x, ev->y, &b->bar->rect)) {
|
||||
snprintf(buf, sizeof(buf), "RightBarClick %s %d\n",
|
||||
b->name, ev->button);
|
||||
write_event(buf);
|
||||
return;
|
||||
|
|
15
rc/wmiirc
15
rc/wmiirc
|
@ -105,16 +105,25 @@ $MODKEY-Shift-9
|
|||
EOF
|
||||
|
||||
# TAG BAR
|
||||
IFS='
|
||||
'
|
||||
for bar in `wmiir ls /lbar`
|
||||
do
|
||||
wmiir rm /lbar/$bar
|
||||
done
|
||||
|
||||
seltag=`wmiir read /tag/sel/ctl`
|
||||
for tag in `wmiir ls /tag | sed -e 's,/$,,; /^sel$/d'`
|
||||
do
|
||||
wmiir create /lbar/$tag
|
||||
if [ "X$tag" = "X$seltag" ]; then
|
||||
xwrite "/lbar/$tag" $WMII_SELCOLORS $tag
|
||||
xwrite /lbar/$tag $WMII_SELCOLORS $tag
|
||||
else
|
||||
xwrite "/lbar/$tag" $WMII_NORMCOLORS $tag
|
||||
xwrite /lbar/$tag $WMII_NORMCOLORS $tag
|
||||
fi
|
||||
done
|
||||
IFS=
|
||||
|
||||
|
||||
# EVENT LOOP
|
||||
wmiir read /event 2>/dev/null |
|
||||
|
@ -144,7 +153,7 @@ do
|
|||
UnfocusTag)
|
||||
xwrite /lbar/$1 $WMII_NORMCOLORS $1
|
||||
;;
|
||||
BarClick)
|
||||
LeftBarClick)
|
||||
xwrite /ctl view "$1";;
|
||||
Key)
|
||||
case "$1" in
|
||||
|
|
Loading…
Reference in New Issue