Re: [dev] wmii noob key binding help

From: Benjamin R. Haskell <suckless_AT_benizi.com>
Date: Wed, 23 Feb 2011 00:15:48 -0500 (EST)

On Tue, 22 Feb 2011, Eitan Goldshtrom wrote:

> Hi. So I read through as much as I could find on the subject of
> defining my own keybindings. I can see how to do it from the 9P
> virtual filesystem that wmii has setup, but I am under the impression
> that it can be done more....properly?...via wmiirc_local and the
> local_events() function. Unfortunately, whatever I try to put in
> there causes wmii to not watch for any input whatsoever, and I get
> locked out from doing anything. Could someone show me an example of
> how to, say, change volume with amixer? I have the cli commands:
>
> amixer sset PCM 4+
> amixer sset PCM 4-
>
> and I would like to bind those commands to Mod-Control-bracketright
> and Mod-Control-bracketleft respectively, or at this point any key
> combination really. Could someone show me how to bind those, for
> example?

E.g.:

Before:

local_events() { true;}

After:

local_events() {
         cat <<'!'
Key XF86AudioRaiseVolume # raise the volume
         amixer sset PCM 4+ &
Key XF86AudioLowerVolume # lower the volume
         amixer sset PCM 4- &
!
}

Since volume control programs should be of the
"return-almost-immediately" variety, I didn't bother with the `eval
wmiir setsid [cmd] &` that most of the default commands seem to use.
(What's the point of the `eval` there?). Makes sense to use the setsid
portion in this example:

local_events() {
         cat <<'!'
Key $ALTKEY-slash # open SSH on a host I frequently use
         eval wmiir setsid $WMII_TERM -e ssh remote.example.com &
!
}

-- 
Best,
Ben
Received on Wed Feb 23 2011 - 06:15:48 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 23 2011 - 06:24:02 CET