[hackers] [wmii] Sync wmiirc and wmiiloop with -test. Fix dividers when making columns with the mouse.

From: Kris Maglione <jg_AT_suckless.org>
Date: Wed May 02 22:48:58 2007

changeset: 2078:e7c95fa1b0a1
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Wed May 02 16:46:26 2007 -0400
summary: Sync wmiirc and wmiiloop with -test. Fix dividers when making columns with the mouse.

diff -r bb35ea06d096 -r e7c95fa1b0a1 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Tue Apr 24 16:20:43 2007 -0400
+++ b/cmd/wmii/mouse.c Wed May 02 16:46:26 2007 -0400
@@ -222,6 +222,7 @@ find_droppoint(Frame *frame, int x, int
                         a = new_column(v, a_prev, 0);
                         send_to_area(a, frame);
                         focus(frame->client, False);
+ focus_view(screen, v);
                 }
                 return;
         }
@@ -231,6 +232,7 @@ find_droppoint(Frame *frame, int x, int
                         a = new_column(v, a, 0);
                         send_to_area(a, frame);
                         focus(frame->client, False);
+ focus_view(screen, v);
                 }
                 return;
         }
diff -r bb35ea06d096 -r e7c95fa1b0a1 cmd/wmiiloop.awk
--- a/cmd/wmiiloop.awk Tue Apr 24 16:20:43 2007 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!AWKPATH -f
-BEGIN {
- arg[1] = "Nop"
- body = "";
- writekeys = "wmiir write /keys"
- print "IFS=''"
-}
-
-function addevent() {
- if(arg[1] == "Key")
- keys[arg[2]] = 1;
-
- var = arg[1] "s"
- print var "=\"$" var " " arg[2] "\""
-
- gsub("[^a-zA-Z_0-9]", "_", arg[2]);
- if(body != "")
- print arg[1] "_" arg[2] "() {" body "\n}"
-}
-
-/^(Event|Key|Action)[ \t]/ {
- addevent()
- split($0, arg)
- body = ""
-}
-/^[ \t]/ {
- body = body"\n"$0
-}
-
-END {
- addevent()
- for(key in keys)
- print key | writekeys;
- close(writekeys);
-}
diff -r bb35ea06d096 -r e7c95fa1b0a1 cmd/wmiiloop.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cmd/wmiiloop.sh Wed May 02 16:46:26 2007 -0400
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+eval "text() {
+ cat <<!
+$(sed '/^[[:blank:]]/s/\([$`]\)/\\\1/g')
+!
+}"
+
+script() {
+ cat <<'!'
+ BEGIN {
+ arg[1] = "Nop"
+ body = "";
+ writekeys = "wmiir write /keys"
+ print "IFS=''"
+ }
+
+ function addevent() {
+ if(arg[1] == "Key")
+ keys[arg[2]] = 1;
+
+ var = arg[1] "s"
+ print var "=\"$" var " " arg[2] "\""
+
+ gsub("[^a-zA-Z_0-9]", "_", arg[2]);
+ if(body != "")
+ print arg[1] "_" arg[2] "() {" body "\n}"
+ }
+
+ /^(Event|Key|Action)[ \t]/ {
+ addevent()
+ split($0, arg)
+ body = ""
+ }
+ /^[ \t]/ {
+ body = body"\n"$0
+ }
+
+ END {
+ addevent()
+ for(key in keys)
+ print key | writekeys;
+ close(writekeys);
+ }
+!
+}
+
+text | awk "`script`"
+
diff -r bb35ea06d096 -r e7c95fa1b0a1 rc/wmiirc.sh
--- a/rc/wmiirc.sh Tue Apr 24 16:20:43 2007 -0400
+++ b/rc/wmiirc.sh Wed May 02 16:46:26 2007 -0400
@@ -13,7 +13,7 @@ WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3
 WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3F'
 
 WMII_BACKGROUND='#333333'
-WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
+WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
 
 set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
 WMII_MENU="dmenu -b -fn $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5"
@@ -39,7 +39,8 @@ status() {
 }
 
 # Event processing
-# processed later by `wmiiloop' and evaled
+# Processed later by `wmiiloop' and evaled.
+# Duplicate the eval line and replace 'eval' with 'echo' for details.
 eventstuff() {
         cat <<'!'
         # Events
@@ -97,20 +98,12 @@ eventstuff() {
         Key $MODKEY-Control-t
                 case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
                 0|1)
- echo -n $Keys | tr ' ' '\012' | wmiir write /keys
+ echo -n \$Keys | tr ' ' '\012' | wmiir write /keys
                         wmiir xwrite /ctl grabmod $MODKEY;;
                 *)
                         wmiir xwrite /keys $MODKEY-Control-t
                         wmiir xwrite /ctl grabmod Mod3;;
                 esac
- Key $MODKEY-$LEFT
- wmiir xwrite /tag/sel/ctl select left
- Key $MODKEY-$RIGHT
- wmiir xwrite /tag/sel/ctl select right
- Key $MODKEY-$DOWN
- wmiir xwrite /tag/sel/ctl select down
- Key $MODKEY-$UP
- wmiir xwrite /tag/sel/ctl select up
         Key $MODKEY-space
                 wmiir xwrite /tag/sel/ctl select toggle
         Key $MODKEY-d
@@ -127,6 +120,20 @@ eventstuff() {
                 wmiir xwrite /ctl "view $(tagsmenu)" &
         Key $MODKEY-Return
                 $WMII_TERM &
+ Key $MODKEY-Shift-space
+ wmiir xwrite /tag/sel/ctl send sel toggle
+ Key $MODKEY-Shift-c
+ wmiir xwrite /client/sel/ctl kill
+ Key $MODKEY-Shift-t
+ wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
+ Key $MODKEY-$LEFT
+ wmiir xwrite /tag/sel/ctl select left
+ Key $MODKEY-$RIGHT
+ wmiir xwrite /tag/sel/ctl select right
+ Key $MODKEY-$DOWN
+ wmiir xwrite /tag/sel/ctl select down
+ Key $MODKEY-$UP
+ wmiir xwrite /tag/sel/ctl select up
         Key $MODKEY-Shift-$LEFT
                 wmiir xwrite /tag/sel/ctl send sel left
         Key $MODKEY-Shift-$RIGHT
@@ -135,12 +142,6 @@ eventstuff() {
                 wmiir xwrite /tag/sel/ctl send sel down
         Key $MODKEY-Shift-$UP
                 wmiir xwrite /tag/sel/ctl send sel up
- Key $MODKEY-Shift-space
- wmiir xwrite /tag/sel/ctl send sel toggle
- Key $MODKEY-Shift-c
- wmiir xwrite /client/sel/ctl kill
- Key $MODKEY-Shift-t
- wmiir xwrite "/client/$(wmiir read /client/sel/ctl)/tags" "$(tagsmenu)" &
 !
         for i in 0 1 2 3 4 5 6 7 8 9; do
                 cat <<!
@@ -162,9 +163,7 @@ EOF
 EOF
 
 # Feed events to `wmiiloop' for processing
-IFS=''
-eval $(eventstuff | sed "s/\\\$MODKEY/$MODKEY/g;s/^[ ]//" | wmiiloop)
-unset IFS
+eval "$(eventstuff | sed 's/^[ ]//' | wmiiloop)"
 
 # Functions
 Action() {
Received on Wed May 02 2007 - 22:48:58 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:43 UTC