vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I've got no feedback on the previous patches I sent (see http://marc.info/?l=openbsd-tech&m=118892902825337&w=2), however, the following two patches add documentation for the configuration parsing code (i've tested that the code works). It also includes documentation for another change which was to add the ability to have keybindings with modifiers other than Mod1 (alt) and Control, namely Mod2, Mod3(super) and Mod4 (windows key). I've been testing this patch for the previous few days to remove any need for xbindkeys, which I used to have some shortcuts to control mpc. The patch also adds all missing functions to the keybindings struct, enabling them to be used. This diff was applied over my previous one, but should be trivial to separate the changes. The manpage diff is correct to the best of my knowledge, someone might need to tweak the english and/or the use of macros, the details should be correct. Also included as an example is ls -l of a .calmwm/keys directory with the default keybindings in it. (some of these weren't possible without adding shift as an extra modifier. If there's no interest in functionality additions to cwm, please let me know. Otherwise any feedback is welcome. Patches follow: ---- extra_mods.diff --- Index: conf.c ================================================== ================= RCS file: /cvs/xenocara/app/cwm/conf.c,v retrieving revision 1.8 diff -u -p -r1.8 conf.c --- conf.c 27 Jun 2007 13:28:22 -0000 1.8 +++ conf.c 4 Sep 2007 23:13:28 -0000 @@ -362,26 +387,47 @@ struct { { "lower", kbfunc_client_lower, KBFLAG_NEEDCLIENT, 0 }, { "raise", kbfunc_client_raise, KBFLAG_NEEDCLIENT, 0 }, { "search", kbfunc_client_search, KBFLAG_NEEDCLIENT, 0 }, + { "menusearch", kbfunc_menu_search, 0, 0 }, { "hide", kbfunc_client_hide, KBFLAG_NEEDCLIENT, 0 }, { "cycle", kbfunc_client_cycle, KBFLAG_NEEDCLIENT, 0 }, { "rcycle", kbfunc_client_rcycle, KBFLAG_NEEDCLIENT, 0 }, { "label", kbfunc_client_label, KBFLAG_NEEDCLIENT, 0 }, { "delete", kbfunc_client_delete, KBFLAG_NEEDCLIENT, 0 }, { "groupselect", kbfunc_client_groupselect, 0, 0 }, - { "group1", kbfunc_client_group, 0, (void *) 1 }, - { "group2", kbfunc_client_group, 0, (void *) 2 }, - { "group3", kbfunc_client_group, 0, (void *) 3 }, - { "group4", kbfunc_client_group, 0, (void *) 4 }, - { "group5", kbfunc_client_group, 0, (void *) 5 }, - { "group6", kbfunc_client_group, 0, (void *) 6 }, - { "group7", kbfunc_client_group, 0, (void *) 7 }, - { "group8", kbfunc_client_group, 0, (void *) 8 }, - { "group9", kbfunc_client_group, 0, (void *) 9 }, - { "nogroup", kbfunc_client_nogroup, 0, 0}, - { "nextgroup", kbfunc_client_nextgroup, 0, 0}, - { "prevgroup", kbfunc_client_prevgroup, 0, 0}, - { "maximize", kbfunc_client_maximize, KBFLAG_NEEDCLIENT, 0}, - { "vmaximize", kbfunc_client_vmaximize, KBFLAG_NEEDCLIENT, 0}, + { "group1", kbfunc_client_group, 0, (void *)1 }, + { "group2", kbfunc_client_group, 0, (void *)2 }, + { "group3", kbfunc_client_group, 0, (void *)3 }, + { "group4", kbfunc_client_group, 0, (void *)4 }, + { "group5", kbfunc_client_group, 0, (void *)5 }, + { "group6", kbfunc_client_group, 0, (void *)6 }, + { "group7", kbfunc_client_group, 0, (void *)7 }, + { "group8", kbfunc_client_group, 0, (void *)8 }, + { "group9", kbfunc_client_group, 0, (void *)9 }, + { "nogroup", kbfunc_client_nogroup, 0, 0 }, + { "nextgroup", kbfunc_client_nextgroup, 0, 0 }, + { "prevgroup", kbfunc_client_prevgroup, 0, 0 }, + { "maximize", kbfunc_client_maximize, KBFLAG_NEEDCLIENT, 0 }, + { "vmaximize", kbfunc_client_vmaximize, KBFLAG_NEEDCLIENT, 0 }, + { "exec", kbfunc_exec, 0, 0 }, + { "ssh", kbfunc_ssh, 0, 0 }, + { "terminal", kbfunc_term, 0, 0 }, + { "lock", kbfunc_lock, 0, 0 }, + { "moveup", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_UP }, + { "movedown", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_DOWN }, + { "moveright", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_RIGHT }, + { "moveleft", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)CWM_LEFT }, + { "bigmoveup", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_UP|CWM_BIGMOVE) }, + { "bigmovedown", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_DOWN|CWM_BIGMOVE) }, + { "bigmoveright", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_RIGHT|CWM_BIGMOVE) }, + { "bigmoveleft", kbfunc_client_move, KBFLAG_NEEDCLIENT, (void *)(CWM_LEFT|CWM_BIGMOVE) }, + { "resizeup", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_UP) }, + { "resizedown", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_DOWN }, + { "resizeright", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_RIGHT }, + { "resizeleft", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)CWM_LEFT }, + { "bigresizeup", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_UP|CWM_BIGMOVE) }, + { "bigresizedown", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_DOWN|CWM_BIGMOVE) }, + { "bigresizeright", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_RIGHT|CWM_BIGMOVE) }, + { "bigresizeleft", kbfunc_client_resize, KBFLAG_NEEDCLIENT, (void *)(CWM_LEFT|CWM_BIGMOVE) }, { NULL, NULL, 0, 0}, }; @@ -434,6 +480,22 @@ conf_parsekeys(struct conf *c, char *fil if (strchr(ent->d_name, 'M') != NULL && strchr(ent->d_name, 'M') < strchr(ent->d_name, '-')) current_binding->modmask |= Mod1Mask; + + if (strchr(ent->d_name, '2') != NULL && + strchr(ent->d_name, '2') < strchr(ent->d_name, '-')) + current_binding->modmask |= Mod2Mask; + + if (strchr(ent->d_name, '3') != NULL && + strchr(ent->d_name, '3') < strchr(ent->d_name, '-')) + current_binding->modmask |= Mod3Mask; + + if (strchr(ent->d_name, '4') != NULL && + strchr(ent->d_name, '4') < strchr(ent->d_name, '-')) + current_binding->modmask |= Mod4Mask; + + if (strchr(ent->d_name, 'S') != NULL && + strchr(ent->d_name, 'S') < strchr(ent->d_name, '-')) + current_binding->modmask |= ShiftMask; substring = strchr(ent->d_name, '-') + 1; ---------- settings_man.diff -------------- --- cwm.1.orig Wed Sep 5 00:47:59 2007 +++ cwm.1 Wed Sep 5 01:52:02 2007 @@ -258,6 +258,64 @@ .Bd -literal -offset indent $ ln -s three ~/.calmwm/.autogroup/XTerm .Ed +.It Pa ~/.calmwm/.settings +Files in this directory cause various configuration options to be +set or unset. +Currently the only setting availiable is whether or not sticky groups +are activated. +To activate sticky groups create a file in this directory with the name +``sticky''. +.It Pa .calmwm/.ignore +Any files in this directory cause +.Nm +to ignore programs by that name by not drawing borders around them. +For example the command +.Bd -literal -offset indent +$ ln -s three ~/.calmwm/.ignore/xclock +.Ed +will cause any instances of +.Xr xclock 1 +to not have borders. +.It Pa .calmwm/.keys +Symlinks in this directory cause the creation of keyboard shortcuts. +If the directory does not exist then the default shortcuts will be +created, otherwise only the shortcuts defined will be created. +The name of a link here is first the modifier, followed by a ``-''. +The following modifiers are recognised: +.Bl -tag -width Ds +.It Pa C +The Control key. +.It Pa M +The Meta key. +.It Pa S +The Shift key. +.It Pa 2 +The Mod2 key. +.It Pa 3 +The Mod3 key. +.It Pa 4 +The Mod4 key (normally the windows key). +.El +The ``-'' should be followed by either a keysym name, taken from +.Pa /usr/X11R6/include/X11/keysymdef.h , +or a numerical keycode value enclosed in ``[]''. +The target of the link should be either the name of a task from the +``name_to_kbfunc'' +structure in +.Pa /usr/src/xenocara/app/cwm/conf.c , +or, alternatively it should be the commandline that is wished to be executed. +For example, to cause +.Ic C-M-r +to add a label to a window: +.Bd -literal -offset indent +$ ln -s "label" ~/.calmwm/.keys/CM-r +.Ed +Launch an xterm running +.Xr top 1 +with C-S-Enter: +.Bd -literal -offset indent +$ ln -s "/usr/X11R6/bin/xterm -e top" ~/.calmwm/.keys/CS-Return +.Ed .El .Sh AUTHORS .An -nosplit ----- ls -l ---(my extra keybindings removed) total 0 lrwxr-xr-x 1 zero zero 10 Sep 5 00:02 C-slash -> menusearch lrwxr-xr-x 1 zero zero 7 Sep 4 23:30 CM-0 -> nogroup lrwxr-xr-x 1 zero zero 6 Sep 4 23:30 CM-1 -> group1 lrwxr-xr-x 1 zero zero 6 Sep 4 23:30 CM-2 -> group2 lrwxr-xr-x 1 zero zero 6 Sep 4 23:30 CM-3 -> group3 lrwxr-xr-x 1 zero zero 6 Sep 4 23:30 CM-4 -> group4 lrwxr-xr-x 1 zero zero 6 Sep 4 23:30 CM-5 -> group5 lrwxr-xr-x 1 zero zero 6 Sep 4 23:31 CM-6 -> group6 lrwxr-xr-x 1 zero zero 6 Sep 4 23:31 CM-7 -> group7 lrwxr-xr-x 1 zero zero 6 Sep 4 23:31 CM-8 -> group8 lrwxr-xr-x 1 zero zero 6 Sep 4 23:31 CM-9 -> group9 lrwxr-xr-x 1 zero zero 4 Sep 4 23:51 CM-Delete -> lock lrwxr-xr-x 1 zero zero 11 Sep 4 23:33 CM-Escape -> groupselect lrwxr-xr-x 1 zero zero 13 Sep 4 23:58 CM-H -> bigresizeleft lrwxr-xr-x 1 zero zero 13 Sep 4 23:57 CM-J -> bigresizedown lrwxr-xr-x 1 zero zero 11 Sep 4 23:57 CM-K -> bigresizeup lrwxr-xr-x 1 zero zero 14 Sep 4 23:58 CM-L -> bigresizeright lrwxr-xr-x 1 zero zero 8 Sep 5 00:03 CM-Return -> terminal lrwxr-xr-x 1 zero zero 9 Sep 5 00:04 CM-equal -> vmaximize lrwxr-xr-x 1 zero zero 8 Sep 4 23:29 CM-f -> maximize lrwxr-xr-x 1 zero zero 10 Sep 4 23:58 CM-h -> resizeleft lrwxr-xr-x 1 zero zero 10 Sep 4 23:57 CM-j -> resizedown lrwxr-xr-x 1 zero zero 8 Sep 4 23:57 CM-k -> resizeup lrwxr-xr-x 1 zero zero 11 Sep 4 23:57 CM-l -> resizeright lrwxr-xr-x 1 zero zero 5 Sep 4 23:36 CM-n -> label lrwxr-xr-x 1 zero zero 6 Sep 4 23:09 CM-x -> delete lrwxr-xr-x 1 zero zero 5 Sep 4 23:27 M-Down -> lower lrwxr-xr-x 1 zero zero 11 Sep 4 23:57 M-H -> bigmoveleft lrwxr-xr-x 1 zero zero 11 Sep 4 23:56 M-J -> bigmovedown lrwxr-xr-x 1 zero zero 9 Sep 4 23:56 M-K -> bigmoveup lrwxr-xr-x 1 zero zero 12 Sep 4 23:57 M-L -> bigmoveright lrwxr-xr-x 1 zero zero 9 Sep 4 23:29 M-Left -> prevgroup lrwxr-xr-x 1 zero zero 4 Sep 5 00:03 M-Return -> hide lrwxr-xr-x 1 zero zero 9 Sep 4 23:29 M-Right -> nextgroup lrwxr-xr-x 1 zero zero 5 Sep 4 23:08 M-Tab -> cycle lrwxr-xr-x 1 zero zero 5 Sep 4 23:27 M-Up -> raise lrwxr-xr-x 1 zero zero 8 Sep 4 23:57 M-h -> moveleft lrwxr-xr-x 1 zero zero 8 Sep 4 23:56 M-j -> movedown lrwxr-xr-x 1 zero zero 6 Sep 4 23:56 M-k -> moveup lrwxr-xr-x 1 zero zero 9 Sep 4 23:56 M-l -> moveright lrwxr-xr-x 1 zero zero 3 Sep 5 00:06 M-period -> ssh lrwxr-xr-x 1 zero zero 4 Sep 5 00:06 M-question -> exec lrwxr-xr-x 1 zero zero 6 Sep 5 00:02 M-slash -> search lrwxr-xr-x 1 zero zero 6 Sep 4 23:26 MS-Tab -> rcycle -- Gordon's first law: If a research project is not worth doing, it is not worth doing well. |