Download raw body.
New 'swap-mods' option patch for cwm to swap modifier keys
On 2024/04/10 15:55:31 -0400, Okan Demirmen <okan@demirmen.com> wrote: > On Wed 2024.04.10 at 19:13 +0000, ZenitDS wrote: > > Hello, > > > > I believe currently there is no possibility to change the modifier keys used > > for the default keybindings. This means that if you want to use the Mod4 key > > instead of Meta, you must unbind all the respective keys and remap them. With > > this new option you can achieve it in a simple way. Use case for this arrives > > when you want to use the Alt key for your applications, and move the default > > Meta modifier to Mod4 for example. > > > > Example of configuration: > > # Swap Meta with Mod4 and Control with Shift > > swap-mods MC 4S > > Something like this has been proposed in the past, but why do this at the > window manager layer and not in your x session (i.e. via xmodmap)? I don't think something like this is possible via xmodmap since the goal of the diff is to rebind the default keybindings to use mod4 instead of Meta, but only for cwm. So that for example, instead of M-Right cwm would implicitly use 4-Right, without having to `unbind-key all' and rebinding all after. (Which is what I currently do to avoid having conflicts with the default cwm keybindings and emacs' ones -- but I also use a 'weird' keyboard layout so I'd have to do something like this anyway.) The proposed swap-mods seems a bit overkill to me however. Could just a `default-prefix 4' be enough? IME the most annoying thing of the default keybinding is the wide use of Meta/Alt which may conflict with some programs. by the way, some nits below on the manpage bits. > > Here is the patch: > > > > Index: cwmrc.5 > > =================================================================== > > RCS file: /cvs/xenocara/app/cwm/cwmrc.5,v > > retrieving revision 1.78 > > diff -u -p -r1.78 cwmrc.5 > > --- cwmrc.5 20 Jul 2023 14:39:34 -0000 1.78 > > +++ cwmrc.5 10 Apr 2024 19:02:53 -0000 > > @@ -207,6 +207,16 @@ The default behavior for new windows is > > By enabling sticky group mode, > > .Xr cwm 1 > > will assign new windows to the currently selected group. > > +.It Ic swap-mods Ar mods1 mods2 > > +Swap modifiers for mouse and keyboard. Modifiers in new sentence, new line > > +.Ar mods1 > > +are swapped with > > +.Ar mods2 > > +in order. The same modifiers are recognised as for same > > +.Ar key > > +in > > +.Nm bind-key . > > +.Pp no need for .Pp here. `man -Tlint -l cwm.1' would help you spotting these nits while editing a mandoc file.
New 'swap-mods' option patch for cwm to swap modifier keys