Re: [dev] wmii noob key binding help

From: Eitan Goldshtrom <thesourceofx_AT_gmail.com>
Date: Wed, 23 Feb 2011 08:54:22 -0500

I tried that just now and it didn't work. I also tried a few variations
that each didn't work. I checked the "keys" file and it looks like the 2
key combinations aren't in the file. I thought they would be added
because of the event declarations, but am I supposed to add them
manually or something? If so, how do I do that? When I try to wmiir
write or xwrite to any of those 9P files it overwrites the whole thing;
I just want to append them.
-Eitan

On 02/23/2011 12:15 AM, Benjamin R. Haskell wrote:
> 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 &
> !
> }
>
Received on Wed Feb 23 2011 - 14:54:22 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 23 2011 - 15:00:05 CET