Re: [wmii] snap: 20060401, easier wmiirc for config shortcuts

From: Suraj N. Kurapati <skurapat_AT_ucsc.edu>
Date: Wed, 05 Apr 2006 12:01:49 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

The wmiirc in the wmii-3 snaps have been cumbersome (because the
same $MODKEY-... text has to be edited in the #SHORTCUTS section and
in the switch(..) statement-block) when configuring shortcuts.

I have put those $MODKEY-... values inside variables for easy
configuration. Also, the variable names can help a new user to learn
the shortcuts more quickly.

The patch is attached. Please change the variable names to how you
like them.

Thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFENBQcmV9O7RYnKMcRAmDzAJ4uoFk5UYf02gqEqfWtl9pfqSthCgCeImPq
27X7dSAiMys6k0/nNdoqafs=
=9ro0
-----END PGP SIGNATURE-----

--- /home/sun/dry/apps/wmii/etc/wmii-3/wmiirc 2006-04-05 10:55:21.000000000 -0700
+++ wmiirc 2006-04-05 11:50:17.000000000 -0700
@@ -41,30 +41,68 @@
 proglist $OLD_PATH >/tmp/ns.$USER.$DISPLAY/progs &
 
 # SHORTCUTS
+
+# wmii
+shortcut_reloadConfig=$MODKEY-Control-w,y
+shortcut_quit=$MODKEY-Control-q,y
+
+shortcut_programsMenu=$MODKEY-Control-p
+shortcut_wmiiMenu=$MODKEY-Control-a
+shortcut_tagsMenu=$MODKEY-Control-t
+shortcut_viewsMenu=$MODKEY-Shift-t
+
+# client
+shortcut_sendClientTo_newColumn=$MODKEY-n
+shortcut_sendClientTo_prevColumn=$MODKEY-Control-h
+shortcut_sendClientTo_nextColumn=$MODKEY-Control-l
+shortcut_sendClientTo_floatingArea=$MODKEY-Shift-space
+
+shortcut_swapClientTo_prevColumn=$MODKEY-Shift-h
+shortcut_swapClientTo_nextColumn=$MODKEY-Shift-l
+shortcut_swapClientTo_belowColumn=$MODKEY-Shift-j
+shortcut_swapClientTo_aboveColumn=$MODKEY-Shift-k
+
+shortcut_closeClient=$MODKEY-Control-c
+
+# focus
+shortcut_putFocusOn_nextColumn=$MODKEY-h
+shortcut_putFocusOn_prevColumn=$MODKEY-l
+shortcut_putFocusOn_prevClient=$MODKEY-j
+shortcut_putFocusOn_nextClient=$MODKEY-k
+shortcut_toggleFocusOn_floatingArea=$MODKEY-space
+
+# layout
+shortcut_applyLayout_max=$MODKEY-m
+shortcut_applyLayout_stack=$MODKEY-s
+shortcut_applyLayout_equal=$MODKEY-e
+
+# util
+shortcut_terminal=$MODKEY-t
+
 wmiir write /def/keys <<EOF
-$MODKEY-Control-c
-$MODKEY-Control-w,y
-$MODKEY-Control-q,y
-$MODKEY-Control-p
-$MODKEY-Control-a
-$MODKEY-Control-t
-$MODKEY-Control-h
-$MODKEY-Control-l
-$MODKEY-Shift-h
-$MODKEY-Shift-l
-$MODKEY-Shift-j
-$MODKEY-Shift-k
-$MODKEY-space
-$MODKEY-Shift-space
-$MODKEY-t
-$MODKEY-h
-$MODKEY-l
-$MODKEY-j
-$MODKEY-k
-$MODKEY-n
-$MODKEY-m
-$MODKEY-s
-$MODKEY-e
+$shortcut_closeClient
+$shortcut_reloadConfig
+$shortcut_quit
+$shortcut_programsMenu
+$shortcut_wmiiMenu
+$shortcut_tagsMenu
+$shortcut_sendClientTo_prevColumn
+$shortcut_sendClientTo_nextColumn
+$shortcut_swapClientTo_prevColumn
+$shortcut_swapClientTo_nextColumn
+$shortcut_swapClientTo_belowColumn
+$shortcut_swapClientTo_aboveColumn
+$shortcut_toggleFocusOn_floatingArea
+$shortcut_sendClientTo_floatingArea
+$shortcut_terminal
+$shortcut_putFocusOn_nextColumn
+$shortcut_putFocusOn_prevColumn
+$shortcut_putFocusOn_prevClient
+$shortcut_putFocusOn_nextClient
+$shortcut_sendClientTo_newColumn
+$shortcut_applyLayout_max
+$shortcut_applyLayout_stack
+$shortcut_applyLayout_equal
 $MODKEY-0
 $MODKEY-1
 $MODKEY-2
@@ -85,7 +123,7 @@
 $MODKEY-Shift-7
 $MODKEY-Shift-8
 $MODKEY-Shift-9
-$MODKEY-Shift-t
+$shortcut_viewsMenu
 EOF
 
 # EVENT LOOP
@@ -104,57 +142,57 @@
                 xwrite /ctl view "$1";;
         Key)
                 case "$1" in
- $MODKEY-Control-c)
+ $shortcut_closeClient)
                         xwrite /view/sel/sel/ctl kill;;
- $MODKEY-Control-w,y)
+ $shortcut_reloadConfig)
                         wmiirc &;;
- $MODKEY-Control-q,y)
+ $shortcut_quit)
                         xwrite /ctl quit;;
- $MODKEY-Control-p)
+ $shortcut_programsMenu)
                         extern `wmiimenu </tmp/ns.$USER.$DISPLAY/progs` &;;
- $MODKEY-Control-a)
+ $shortcut_wmiiMenu)
                         `proglist /home/sun/dry/apps/wmii/etc/wmii-3:$HOME/.wmii-3 | wmiimenu` &;;
- $MODKEY-t)
+ $shortcut_terminal)
                         extern xterm &;;
- $MODKEY-m)
+ $shortcut_applyLayout_max)
                         xwrite /view/sel/mode max;;
- $MODKEY-s)
+ $shortcut_applyLayout_stack)
                         xwrite /view/sel/mode stack;;
- $MODKEY-e)
+ $shortcut_applyLayout_equal)
                         xwrite /view/sel/mode equal;;
- $MODKEY-n)
+ $shortcut_sendClientTo_newColumn)
                         xwrite /view/sel/sel/ctl sendto new;;
- $MODKEY-Control-h)
+ $shortcut_sendClientTo_prevColumn)
                         xwrite /view/sel/sel/ctl sendto prev;;
- $MODKEY-Control-l)
+ $shortcut_sendClientTo_nextColumn)
                         xwrite /view/sel/sel/ctl sendto next;;
- $MODKEY-Shift-h)
+ $shortcut_swapClientTo_prevColumn)
                         xwrite /view/sel/sel/ctl swap prev;;
- $MODKEY-Shift-l)
+ $shortcut_swapClientTo_nextColumn)
                         xwrite /view/sel/sel/ctl swap next;;
- $MODKEY-Shift-j)
+ $shortcut_swapClientTo_belowColumn)
                         xwrite /view/sel/sel/ctl swap down;;
- $MODKEY-Shift-k)
+ $shortcut_swapClientTo_aboveColumn)
                         xwrite /view/sel/sel/ctl swap up;;
- $MODKEY-space)
+ $shortcut_toggleFocusOn_floatingArea)
                         xwrite /view/ctl select toggle;;
- $MODKEY-Shift-space)
+ $shortcut_sendClientTo_floatingArea)
                         xwrite /view/sel/sel/ctl sendto toggle;;
- $MODKEY-h)
+ $shortcut_putFocusOn_nextColumn)
                         xwrite /view/ctl select prev;;
- $MODKEY-l)
+ $shortcut_putFocusOn_prevColumn)
                         xwrite /view/ctl select next;;
- $MODKEY-j)
+ $shortcut_putFocusOn_prevClient)
                         xwrite /view/sel/ctl select next;;
- $MODKEY-k)
+ $shortcut_putFocusOn_nextClient)
                         xwrite /view/sel/ctl select prev;;
                 $MODKEY-[0-9])
                         xwrite /ctl view `echo $1 | sed 's/.*-//'`;;
- $MODKEY-Control-t)
+ $shortcut_tagsMenu)
                         xwrite /ctl view "`wmiir read /tags | wmiimenu`" &;;
                 $MODKEY-Shift-[0-9])
                         xwrite /view/sel/sel/tags `echo $1 | sed 's/.*-//'`;;
- $MODKEY-Shift-t)
+ $shortcut_viewsMenu)
                         xwrite /view/sel/sel/tags "`wmiir read /view/sel/sel/tags | wmiimenu`" &;;
                 esac;;
         esac
Received on Wed Apr 05 2006 - 21:04:26 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:01:53 UTC