Re: [wmii] Re: Using wmii with NX

From: Kris Maglione <>
Date: Tue, 28 Oct 2008 23:54:40 -0400

On Tue, Oct 28, 2008 at 06:41:10PM -0500, Naren wrote:
>Is there a way to tell wmii to not capture the keybindings when a
>window is in fullscreen mode or something like that ? What other way
>can I deal with this ?

I actually have a very similar situation using Xephyr to test
wmii. I have a special tag, 'x', that automatically removes all
key bindings when selected and removes them when deselected.
The Mod-x binding is the exception, as it toggles between the
'x' tag and the previous tag, no matter what. The following rc
code does the job for me:

# A special hack for running Xephyr. When switching to the ‘x’ tag,
# disable all key and mouse bindings so I can run a test instance
# of wmii there. The M-x binding is the only one retained, and can
# toggle between the ‘x’ view and the previous view.
fn Key-$MODKEY-x {
        seltag = `{wi_seltag}
        switch($"seltag) {
        case x
                if(~ $"_x_tag '')
                        wmiir xwrite /ctl view $viewprev
                if not
                        wmiir xwrite /ctl view $_x_tag
        case *
                _x_tag = $seltag
                wmiir xwrite /ctl view x

# Also, add a M-i binding to toggle between the two most
# recent views. For convenience, this code is tied to the
# M-x code.
fn Key-$mod-i {
        wmiir xwrite /ctl view $viewprev}

fn Event-UnfocusTag {
        if(! ~ $"* x)
        wmiir xwrite /lbar/$"* $wmiinormcol $*}
fn Event-FocusTag {
        wmiir xwrite /lbar/$"* $wmiifocuscol $*
        switch($"*) {
        case x
                ifs=() { _x_keys=`{wmiir read /keys} }
                wmiir xwrite /keys $MODKEY-x
                wmiir xwrite /ctl grabmod Mod3
                wiwarp `{rc -c 'DISPLAY=:1 wilsptr'}
                # wi ls ptr: print pointer coordinates
        case *
                if(! ~ $"_x_keys '') {
                        wmiir xwrite /ctl grabmod $MODKEY
                        wmiir xwrite /keys $_x_keys
                        _x_keys=() }

It could probably be simplified a bit, but I haven't looked at
it in a while.

Kris Maglione
Fast, fat computers breed slow, lazy programmers.
	--Robert Hummel
Received on Wed Oct 29 2008 - 03:54:40 UTC

This archive was generated by hypermail 2.2.0 : Wed Oct 29 2008 - 04:00:08 UTC