Re: wmii-lua ignores Mod4 (Windows key)

18 views
Skip to first unread message

Bart Trojanowski

unread,
Mar 15, 2010, 2:10:25 PM3/15/10
to David Unric, wmii-lua list
Hi David,

I don't think grabmod does what you think it does.  wmii-lua just passes grabmod to wmii, and does nothing with it.  wmii uses grabmod to control which modifier can be used to move the windows with the mouse.  Like Mod1-left click drag will move windows when they are floating, etc.  That is completely outside the scope of what wmii-lua looks at.

wmii-lua does not (yet) have a way to set a global mod key from the rc config.  If you want to modify how your keybindings work, edit .wmii-lua/core/wmii.lua.

You could also 'remap_key_handler' function in your wmiirc to change the defaults:

    wmii.remap_key_handler ("Mod1-r", "Mod4-r")

... but you'd have to do it for all the keys defined in key_handlers (see .wmii-lua/core/wmii.lua).

I am going to add a case on github to track this request.  I'll try to fix it when I am back from a conference I am speaking at next week.

-Bart

On Mon, Mar 15, 2010 at 12:53 PM, David Unric <dunr...@gmail.com> wrote:
Hi,

I've some issue with the latest wmii-lua. Mod key (grabkey) setting does not work.
See following forwarded mail for details.

Take care.

David

---------- Forwarded message ----------
From: David <dunr...@gmail.com>
Date: Sun, Mar 14, 2010 at 8:32 PM
Subject: wmii-lua ignores Mod4 (Windows key)
To: wmii-lua <wmii...@googlegroups.com>


Although configured properly (AFAIK), wmii-lua ignores mod-key
setting. Only action and program menu is accessible but still with
Mod1. Views/tags switching does not work.
Other configuration settings like font, colors, border width etc. _do_
apply.
No error messages in ~/.xsession-errors.log .

libixp-hg, wmii-hg, wmii-lua (today git mirror), lua 5.1.4

shell/python/ruby "event loop" wrappers work as expected on the same
machine


------------------------------- my config
-----------------------------------------------------
#!/usr/bin/env lua
--
-- Copyrigh (c) 2007, Bart Trojanowski <ba...@jukie.net>
--
-- Some stuff below will eventually go to a separate file, and
configuration
-- will remain here similar to the split between the wmii+ruby wmiirc
and
-- wmiirc-config.  For now I just want to get the feel of how things
will
-- work in lua.
--
-- http://www.jukie.net/~bart/blog/tag/wmiirc-lua
-- git://www.jukie.net/wmiirc-lua.git/
--

io.stderr:write ("----------------------------------------------\n")

-- load wmii.lua
local wmiidir = ("~/.wmii-hg"):gsub("^~", os.getenv("HOME"))
package.path  = wmiidir .. "/core/?.lua;"       ..
               wmiidir .. "/plugins/?.lua;"    ..
               package.path
require "wmii"
require "os"

-- Setup my environment (completely optional)

local hostname = os.getenv("HOSTNAME")
local homedir  = os.getenv("HOME") or "~"

--[[
       -- conditionally load up my xmodmaprc
       if type(hostname) == 'string' and hostname:match("^oxygen")
then
               os.execute ("xmodmap ~/.xmodmaprc")
       end

       -- add ssh keys if they are not in the agent already
       os.execute ("if ( ! ssh-add -l >/dev/null ) || test $(ssh-add -
l | wc -l) = 0 ; then "
                       .. "ssh-add </dev/null ; fi")

       -- this lets me have progyfonts in ~/.fonts
       os.execute ("~/.fonts/rebuild")

       -- restore the mixer settings
       os.execute ("aumix -L")

       -- this hids the mouse cursor after a timeout
       os.execute ("unclutter &")

       -- configure X
       os.execute ("xset r on")
       os.execute ("xset r rate 200 25")
       os.execute ("xset b off")
       os.execute ("xrandr --dpi 96")

       -- clear the background
       os.execute ("xsetroot -solid black")

       -- this will prime the alt-p menu's cache
       os.execute ("dmenu_path>/dev/null&")
--]]

-- This is the base configuration of wmii, it writes to the /ctl file.
wmii.set_ctl ({
       border      = 2,
       font        =
'xft:Terminus:regular:pixelsize=20:encoding=iso10646-1',
       focuscolors = '#FFFFaa #007700 #88ff88',
       normcolors  = '#FFFFFF #222222 #333333',
       grabmod     = 'Mod4'
})

-- Set slightly different colors on each screen.
wmii.set_screen_ctl(0, {
       focuscolors = '#FFFFaa #007700 #88ff88'
})
wmii.set_screen_ctl(1, {
       focuscolors = '#FFFFaa #770000 #ff8888'
})
wmii.set_screen_ctl(2, {
       focuscolors = '#FFFFaa #000077 #8888ff'
})

-- This overrides some variables that are used by event and key
handlers.
--   TODO: need to have a list of the standard ones somewhere.
--         For now look in the wmii.lua for the key_handlers table, it
--         will reference the variables as getconf("varname").
-- If you add your own actions, or key handlers you are encouraged to
-- use configuration values as appropriate with wmii.setconf("var",
"val"), or
-- as a table like the example below.
wmii.set_conf ({
       xterm = 'urxvtc',
       -- xlock = '/usr/bin/xtrlock',
       -- debug = true,
})

-- colrules file contains a list of rules which affect the width of
newly
-- created columns.  Rules have a form of
--      /regexp/ -> width[+width[+width...]]
-- When a new column, n, is created on a view whose name matches
regex, the
-- n'th given width percentage of the screen is given to it.  If there
is
-- no nth width, 1/ncolth of the screen is given to it.
--
wmii.write ("/colrules", "/.*/ -> 50+50\n"
                     .. "/gaim/ -> 80+20\n")

-- tagrules file contains a list of riles which affect which tags are
-- applied to a new client.  Rules has a form of
--      /regexp/ -> tag[+tag[+tag...]]
-- When client's name:class:title matches regex, it is given the
-- tagstring tag(s).  There are two special tags:
--      sel (or the deprecated form: !) represents the current tag,
and
--      ~ which represents the floating layer
wmii.write ("/tagrules", "/XMMS.*/ -> ~\n"
                     .. "/Firefox.*/ -> www\n"
                     .. "/Iceweasel.*/ -> www\n"
                     .. "/vimperator/ -> www\n"
                     .. "/a[Kk]regator/ -> www\n"
                     .. "/Gimp.*/ -> ~\n"
                     .. "/Gimp.*/ -> gimp\n"
                     .. "/Gaim.*/ -> gaim\n"
                     .. "/gitk/ -> ~\n"
                     .. "/MPlayer.*/ -> ~\n"
                     .. "/x?vnc[^ ]*viewer.*/ -> ~\n"
                     .. "/VNC.*:VNC.*/ -> ~\n"
                     .. "/.*/ -> sel\n"
                     .. "/.*/ -> 1\n")

-- load some plugins
wmii.load_plugin ("messages")
wmii.load_plugin ("clock")
wmii.load_plugin ("loadavg")
wmii.load_plugin ("volume")
wmii.load_plugin ("browser")
wmii.load_plugin ("view_workdir")
wmii.load_plugin ("cpu")

wmii.load_plugin ("battery")
wmii.set_conf("battery.names", "BAT0")

wmii.load_plugin ("ssh")
wmii.add_key_handler ("Mod4-z", ssh.show_menu)

-- other handlers

wmii.add_key_handler ('XF86KbdBrightnessUp',   function (key)
os.execute("xbacklight -steps 1 -time 0 -inc 10") end)
wmii.add_key_handler ('XF86KbdBrightnessDown', function (key)
os.execute("xbacklight -steps 1 -time 0 -dec 10") end)

wmii.add_action_handler ("hibernate-disk",
function(act,args)
       os.execute ('gksudo hibernate-disk')
end)



-- here are some other examples...
--[[

-- use Mod1-tab to flip to the previous view
wmii.remap_key_handler ("Mod1-r", "Mod1-tab")

--]]

--
------------------------------------------------------------------------
-- configuration is finished, run the event loop
wmii.run_event_loop()

------------------------------- my config
-----------------------------------------------------




--
http://www.jukie.net/~bart/sig

Bart Trojanowski

unread,
Mar 15, 2010, 2:19:08 PM3/15/10
to David Unric, wmii-lua list
Reply all
Reply to author
Forward
0 new messages