mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Normalize bind function names, based on a few categories: window, group, menu
and pointer. Replace 'bind' and 'mousebind' options with 'bind-key' and 'bind-mouse', respectively, replace special 'unmap' keyword with 'unbind-key' and 'unbind-mouse', and additionally allow unbinding all with 'all' keyword.
This commit is contained in:
parent
ae9f900b91
commit
d968a6c1bf
402
conf.c
402
conf.c
@ -35,7 +35,9 @@
|
|||||||
static const char *conf_bind_getmask(const char *, unsigned int *);
|
static const char *conf_bind_getmask(const char *, unsigned int *);
|
||||||
static void conf_cmd_remove(struct conf *, const char *);
|
static void conf_cmd_remove(struct conf *, const char *);
|
||||||
static void conf_unbind_key(struct conf *, struct bind_ctx *);
|
static void conf_unbind_key(struct conf *, struct bind_ctx *);
|
||||||
|
static void conf_unbind_key_all(struct conf *);
|
||||||
static void conf_unbind_mouse(struct conf *, struct bind_ctx *);
|
static void conf_unbind_mouse(struct conf *, struct bind_ctx *);
|
||||||
|
static void conf_unbind_mouse_all(struct conf *);
|
||||||
|
|
||||||
static int cursor_binds[] = {
|
static int cursor_binds[] = {
|
||||||
XC_left_ptr, /* CF_NORMAL */
|
XC_left_ptr, /* CF_NORMAL */
|
||||||
@ -60,129 +62,129 @@ static const struct {
|
|||||||
int context;
|
int context;
|
||||||
union arg argument;
|
union arg argument;
|
||||||
} name_to_func[] = {
|
} name_to_func[] = {
|
||||||
{ "lower", kbfunc_client_lower, CWM_CONTEXT_CC, {0} },
|
{ "window-menu-label", kbfunc_menu_client_label, CWM_CONTEXT_CC, {0} },
|
||||||
{ "raise", kbfunc_client_raise, CWM_CONTEXT_CC, {0} },
|
{ "window-lower", kbfunc_client_lower, CWM_CONTEXT_CC, {0} },
|
||||||
{ "search", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
{ "window-raise", kbfunc_client_raise, CWM_CONTEXT_CC, {0} },
|
||||||
{ "menusearch", kbfunc_menu_cmd, CWM_CONTEXT_SC, {0} },
|
{ "window-search", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
||||||
{ "groupsearch", kbfunc_menu_group, CWM_CONTEXT_SC, {0} },
|
{ "window-hide", kbfunc_client_hide, CWM_CONTEXT_CC, {0} },
|
||||||
{ "hide", kbfunc_client_hide, CWM_CONTEXT_CC, {0} },
|
{ "window-delete", kbfunc_client_delete, CWM_CONTEXT_CC, {0} },
|
||||||
{ "cycle", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
{ "window-htile", kbfunc_client_htile, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-vtile", kbfunc_client_vtile, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-stick", kbfunc_client_toggle_sticky, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-fullscreen", kbfunc_client_toggle_fullscreen, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-maximize", kbfunc_client_toggle_maximize, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-vmaximize", kbfunc_client_toggle_vmaximize, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-hmaximize", kbfunc_client_toggle_hmaximize, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-freeze", kbfunc_client_toggle_freeze, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-cycle", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
||||||
{.i = (CWM_CYCLE_FORWARD)} },
|
{.i = (CWM_CYCLE_FORWARD)} },
|
||||||
{ "rcycle", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
{ "window-rcycle", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
||||||
{.i = (CWM_CYCLE_REVERSE)} },
|
{.i = (CWM_CYCLE_REVERSE)} },
|
||||||
{ "label", kbfunc_menu_client_label, CWM_CONTEXT_CC, {0} },
|
{ "window-cycle-ingroup", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
||||||
{ "delete", kbfunc_client_delete, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "group1", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 1} },
|
|
||||||
{ "group2", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 2} },
|
|
||||||
{ "group3", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 3} },
|
|
||||||
{ "group4", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 4} },
|
|
||||||
{ "group5", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 5} },
|
|
||||||
{ "group6", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 6} },
|
|
||||||
{ "group7", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 7} },
|
|
||||||
{ "group8", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 8} },
|
|
||||||
{ "group9", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 9} },
|
|
||||||
{ "grouponly1", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 1} },
|
|
||||||
{ "grouponly2", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 2} },
|
|
||||||
{ "grouponly3", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 3} },
|
|
||||||
{ "grouponly4", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 4} },
|
|
||||||
{ "grouponly5", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 5} },
|
|
||||||
{ "grouponly6", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 6} },
|
|
||||||
{ "grouponly7", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 7} },
|
|
||||||
{ "grouponly8", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 8} },
|
|
||||||
{ "grouponly9", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 9} },
|
|
||||||
{ "movetogroup1", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 1} },
|
|
||||||
{ "movetogroup2", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 2} },
|
|
||||||
{ "movetogroup3", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 3} },
|
|
||||||
{ "movetogroup4", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 4} },
|
|
||||||
{ "movetogroup5", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 5} },
|
|
||||||
{ "movetogroup6", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 6} },
|
|
||||||
{ "movetogroup7", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 7} },
|
|
||||||
{ "movetogroup8", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 8} },
|
|
||||||
{ "movetogroup9", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 9} },
|
|
||||||
{ "nogroup", kbfunc_group_alltoggle, CWM_CONTEXT_SC, {0} },
|
|
||||||
{ "cyclegroup", kbfunc_group_cycle, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_CYCLE_FORWARD)} },
|
|
||||||
{ "rcyclegroup", kbfunc_group_cycle, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_CYCLE_REVERSE)} },
|
|
||||||
{ "cycleingroup", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_CYCLE_FORWARD | CWM_CYCLE_INGROUP)} },
|
{.i = (CWM_CYCLE_FORWARD | CWM_CYCLE_INGROUP)} },
|
||||||
{ "rcycleingroup", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
{ "window-rcycle-ingroup", kbfunc_client_cycle, CWM_CONTEXT_SC,
|
||||||
{.i = (CWM_CYCLE_REVERSE | CWM_CYCLE_INGROUP)} },
|
{.i = (CWM_CYCLE_REVERSE | CWM_CYCLE_INGROUP)} },
|
||||||
{ "grouptoggle", kbfunc_client_toggle_group, CWM_CONTEXT_CC, {0} },
|
{ "window-group", kbfunc_client_toggle_group, CWM_CONTEXT_CC, {0} },
|
||||||
{ "stick", kbfunc_client_toggle_sticky, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-1", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 1} },
|
||||||
{ "fullscreen", kbfunc_client_toggle_fullscreen, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-2", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 2} },
|
||||||
{ "maximize", kbfunc_client_toggle_maximize, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-3", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 3} },
|
||||||
{ "vmaximize", kbfunc_client_toggle_vmaximize, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-4", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 4} },
|
||||||
{ "hmaximize", kbfunc_client_toggle_hmaximize, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-5", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 5} },
|
||||||
{ "freeze", kbfunc_client_toggle_freeze, CWM_CONTEXT_CC, {0} },
|
{ "window-movetogroup-6", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 6} },
|
||||||
{ "restart", kbfunc_cwm_status, CWM_CONTEXT_SC, {.i = CWM_EXEC_WM} },
|
{ "window-movetogroup-7", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 7} },
|
||||||
{ "quit", kbfunc_cwm_status, CWM_CONTEXT_SC, {.i = CWM_QUIT} },
|
{ "window-movetogroup-8", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 8} },
|
||||||
{ "exec", kbfunc_menu_exec, CWM_CONTEXT_SC,
|
{ "window-movetogroup-9", kbfunc_client_movetogroup, CWM_CONTEXT_CC, {.i = 9} },
|
||||||
|
|
||||||
|
{ "window-move", mousefunc_client_move, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-move-up", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_UP)} },
|
||||||
|
{ "window-move-down", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_DOWN)} },
|
||||||
|
{ "window-move-right", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_RIGHT)} },
|
||||||
|
{ "window-move-left", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_LEFT)} },
|
||||||
|
{ "window-move-up-big", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-move-down-big", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-move-right-big", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-move-left-big", kbfunc_client_move, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-resize", mousefunc_client_resize, CWM_CONTEXT_CC, {0} },
|
||||||
|
{ "window-resize-up", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_UP)} },
|
||||||
|
{ "window-resize-down", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_DOWN)} },
|
||||||
|
{ "window-resize-right", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_RIGHT)} },
|
||||||
|
{ "window-resize-left", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_LEFT)} },
|
||||||
|
{ "window-resize-up-big", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-resize-down-big", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-resize-right-big", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
||||||
|
{ "window-resize-left-big", kbfunc_client_resize, CWM_CONTEXT_CC,
|
||||||
|
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
||||||
|
|
||||||
|
{ "group-cycle", kbfunc_group_cycle, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_CYCLE_FORWARD)} },
|
||||||
|
{ "group-rcycle", kbfunc_group_cycle, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_CYCLE_REVERSE)} },
|
||||||
|
{ "group-toggle-all", kbfunc_group_alltoggle, CWM_CONTEXT_SC, {0} },
|
||||||
|
{ "group-toggle-1", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 1} },
|
||||||
|
{ "group-toggle-2", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 2} },
|
||||||
|
{ "group-toggle-3", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 3} },
|
||||||
|
{ "group-toggle-4", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 4} },
|
||||||
|
{ "group-toggle-5", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 5} },
|
||||||
|
{ "group-toggle-6", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 6} },
|
||||||
|
{ "group-toggle-7", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 7} },
|
||||||
|
{ "group-toggle-8", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 8} },
|
||||||
|
{ "group-toggle-9", kbfunc_group_toggle, CWM_CONTEXT_SC, {.i = 9} },
|
||||||
|
{ "group-only-1", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 1} },
|
||||||
|
{ "group-only-2", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 2} },
|
||||||
|
{ "group-only-3", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 3} },
|
||||||
|
{ "group-only-4", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 4} },
|
||||||
|
{ "group-only-5", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 5} },
|
||||||
|
{ "group-only-6", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 6} },
|
||||||
|
{ "group-only-7", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 7} },
|
||||||
|
{ "group-only-8", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 8} },
|
||||||
|
{ "group-only-9", kbfunc_group_only, CWM_CONTEXT_SC, {.i = 9} },
|
||||||
|
|
||||||
|
{ "pointer-move-up", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_UP)} },
|
||||||
|
{ "pointer-move-down", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_DOWN)} },
|
||||||
|
{ "pointer-move-left", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_LEFT)} },
|
||||||
|
{ "pointer-move-right", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_RIGHT)} },
|
||||||
|
{ "pointer-move-up-big", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
||||||
|
{ "pointer-move-down-big", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
||||||
|
{ "pointer-move-left-big", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
||||||
|
{ "pointer-move-right-big", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
||||||
|
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
||||||
|
|
||||||
|
{ "menu-cmd", kbfunc_menu_cmd, CWM_CONTEXT_SC, {0} },
|
||||||
|
{ "menu-group", kbfunc_menu_group, CWM_CONTEXT_SC, {0} },
|
||||||
|
{ "menu-ssh", kbfunc_menu_ssh, CWM_CONTEXT_SC, {0} },
|
||||||
|
{ "menu-window", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
||||||
|
{ "menu-exec", kbfunc_menu_exec, CWM_CONTEXT_SC,
|
||||||
{.i = CWM_MENU_EXEC_EXEC} },
|
{.i = CWM_MENU_EXEC_EXEC} },
|
||||||
{ "exec_wm", kbfunc_menu_exec, CWM_CONTEXT_SC,
|
{ "menu-exec-wm", kbfunc_menu_exec, CWM_CONTEXT_SC,
|
||||||
{.i = CWM_MENU_EXEC_WM} },
|
{.i = CWM_MENU_EXEC_WM} },
|
||||||
{ "ssh", kbfunc_menu_ssh, CWM_CONTEXT_SC, {0} },
|
|
||||||
{ "terminal", kbfunc_exec_term, CWM_CONTEXT_SC, {0} },
|
{ "terminal", kbfunc_exec_term, CWM_CONTEXT_SC, {0} },
|
||||||
{ "lock", kbfunc_exec_lock, CWM_CONTEXT_SC, {0} },
|
{ "lock", kbfunc_exec_lock, CWM_CONTEXT_SC, {0} },
|
||||||
{ "moveup", kbfunc_client_move, CWM_CONTEXT_CC,
|
{ "restart", kbfunc_cwm_status, CWM_CONTEXT_SC, {.i = CWM_EXEC_WM} },
|
||||||
{.i = (CWM_UP)} },
|
{ "quit", kbfunc_cwm_status, CWM_CONTEXT_SC, {.i = CWM_QUIT} },
|
||||||
{ "movedown", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_DOWN)} },
|
|
||||||
{ "moveright", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_RIGHT)} },
|
|
||||||
{ "moveleft", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_LEFT)} },
|
|
||||||
{ "bigmoveup", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigmovedown", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigmoveright", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigmoveleft", kbfunc_client_move, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "resizeup", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_UP)} },
|
|
||||||
{ "resizedown", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_DOWN)} },
|
|
||||||
{ "resizeright", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_RIGHT)} },
|
|
||||||
{ "resizeleft", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_LEFT)} },
|
|
||||||
{ "bigresizeup", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigresizedown", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigresizeright", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigresizeleft", kbfunc_client_resize, CWM_CONTEXT_CC,
|
|
||||||
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "ptrmoveup", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_UP)} },
|
|
||||||
{ "ptrmovedown", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_DOWN)} },
|
|
||||||
{ "ptrmoveleft", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_LEFT)} },
|
|
||||||
{ "ptrmoveright", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_RIGHT)} },
|
|
||||||
{ "bigptrmoveup", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_UP | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigptrmovedown", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_DOWN | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigptrmoveleft", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_LEFT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "bigptrmoveright", kbfunc_ptrmove, CWM_CONTEXT_SC,
|
|
||||||
{.i = (CWM_RIGHT | CWM_BIGAMOUNT)} },
|
|
||||||
{ "htile", kbfunc_client_htile, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "vtile", kbfunc_client_vtile, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_lower", kbfunc_client_lower, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_raise", kbfunc_client_raise, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_hide", kbfunc_client_hide, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_move", mousefunc_client_move, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_resize", mousefunc_client_resize, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "window_grouptoggle", kbfunc_client_toggle_group, CWM_CONTEXT_CC, {0} },
|
|
||||||
{ "menu_group", kbfunc_menu_group, CWM_CONTEXT_SC, {0} },
|
|
||||||
{ "menu_unhide", kbfunc_menu_client, CWM_CONTEXT_SC, {0} },
|
|
||||||
{ "menu_cmd", kbfunc_menu_cmd, CWM_CONTEXT_SC, {0} },
|
|
||||||
};
|
};
|
||||||
static unsigned int ignore_mods[] = {
|
static unsigned int ignore_mods[] = {
|
||||||
0, LockMask, Mod2Mask, Mod2Mask | LockMask
|
0, LockMask, Mod2Mask, Mod2Mask | LockMask
|
||||||
@ -202,66 +204,66 @@ static const struct {
|
|||||||
} key_binds[] = {
|
} key_binds[] = {
|
||||||
{ "CM-Return", "terminal" },
|
{ "CM-Return", "terminal" },
|
||||||
{ "CM-Delete", "lock" },
|
{ "CM-Delete", "lock" },
|
||||||
{ "M-question", "exec" },
|
{ "M-question", "menu-exec" },
|
||||||
{ "CM-w", "exec_wm" },
|
{ "CM-w", "menu-exec-wm" },
|
||||||
{ "M-period", "ssh" },
|
{ "M-period", "menu-ssh" },
|
||||||
{ "M-Return", "hide" },
|
{ "M-Return", "window-hide" },
|
||||||
{ "M-Down", "lower" },
|
{ "M-Down", "window-lower" },
|
||||||
{ "M-Up", "raise" },
|
{ "M-Up", "window-raise" },
|
||||||
{ "M-slash", "search" },
|
{ "M-slash", "menu-window" },
|
||||||
{ "C-slash", "menusearch" },
|
{ "C-slash", "menu-cmd" },
|
||||||
{ "M-Tab", "cycle" },
|
{ "M-Tab", "window-cycle" },
|
||||||
{ "MS-Tab", "rcycle" },
|
{ "MS-Tab", "window-rcycle" },
|
||||||
{ "CM-n", "label" },
|
{ "CM-n", "window-menu-label" },
|
||||||
{ "CM-x", "delete" },
|
{ "CM-x", "window-delete" },
|
||||||
{ "CM-a", "nogroup" },
|
{ "CM-a", "group-toggle-all" },
|
||||||
{ "CM-0", "nogroup" },
|
{ "CM-0", "group-toggle-all" },
|
||||||
{ "CM-1", "group1" },
|
{ "CM-1", "group-toggle-1" },
|
||||||
{ "CM-2", "group2" },
|
{ "CM-2", "group-toggle-2" },
|
||||||
{ "CM-3", "group3" },
|
{ "CM-3", "group-toggle-3" },
|
||||||
{ "CM-4", "group4" },
|
{ "CM-4", "group-toggle-4" },
|
||||||
{ "CM-5", "group5" },
|
{ "CM-5", "group-toggle-5" },
|
||||||
{ "CM-6", "group6" },
|
{ "CM-6", "group-toggle-6" },
|
||||||
{ "CM-7", "group7" },
|
{ "CM-7", "group-toggle-7" },
|
||||||
{ "CM-8", "group8" },
|
{ "CM-8", "group-toggle-8" },
|
||||||
{ "CM-9", "group9" },
|
{ "CM-9", "group-toggle-9" },
|
||||||
{ "M-Right", "cyclegroup" },
|
{ "M-Right", "group-cycle" },
|
||||||
{ "M-Left", "rcyclegroup" },
|
{ "M-Left", "group-rcycle" },
|
||||||
{ "CM-g", "grouptoggle" },
|
{ "CM-g", "window-group" },
|
||||||
{ "CM-f", "fullscreen" },
|
{ "CM-f", "window-fullscreen" },
|
||||||
{ "CM-m", "maximize" },
|
{ "CM-m", "window-maximize" },
|
||||||
{ "CM-s", "stick" },
|
{ "CM-s", "window-stick" },
|
||||||
{ "CM-equal", "vmaximize" },
|
{ "CM-equal", "window-vmaximize" },
|
||||||
{ "CMS-equal", "hmaximize" },
|
{ "CMS-equal", "window-hmaximize" },
|
||||||
{ "CMS-f", "freeze" },
|
{ "CMS-f", "window-freeze" },
|
||||||
{ "CMS-r", "restart" },
|
{ "CMS-r", "restart" },
|
||||||
{ "CMS-q", "quit" },
|
{ "CMS-q", "quit" },
|
||||||
{ "M-h", "moveleft" },
|
{ "M-h", "window-move-left" },
|
||||||
{ "M-j", "movedown" },
|
{ "M-j", "window-move-down" },
|
||||||
{ "M-k", "moveup" },
|
{ "M-k", "window-move-up" },
|
||||||
{ "M-l", "moveright" },
|
{ "M-l", "window-move-right" },
|
||||||
{ "MS-h", "bigmoveleft" },
|
{ "MS-h", "window-move-left-big" },
|
||||||
{ "MS-j", "bigmovedown" },
|
{ "MS-j", "window-move-down-big" },
|
||||||
{ "MS-k", "bigmoveup" },
|
{ "MS-k", "window-move-up-big" },
|
||||||
{ "MS-l", "bigmoveright" },
|
{ "MS-l", "window-move-right-big" },
|
||||||
{ "CM-h", "resizeleft" },
|
{ "CM-h", "window-resize-left" },
|
||||||
{ "CM-j", "resizedown" },
|
{ "CM-j", "window-resize-down" },
|
||||||
{ "CM-k", "resizeup" },
|
{ "CM-k", "window-resize-up" },
|
||||||
{ "CM-l", "resizeright" },
|
{ "CM-l", "window-resize-right" },
|
||||||
{ "CMS-h", "bigresizeleft" },
|
{ "CMS-h", "window-resize-left-big" },
|
||||||
{ "CMS-j", "bigresizedown" },
|
{ "CMS-j", "window-resize-down-big" },
|
||||||
{ "CMS-k", "bigresizeup" },
|
{ "CMS-k", "window-resize-up-big" },
|
||||||
{ "CMS-l", "bigresizeright" },
|
{ "CMS-l", "window-resize-right-big" },
|
||||||
},
|
},
|
||||||
mouse_binds[] = {
|
mouse_binds[] = {
|
||||||
{ "1", "menu_unhide" },
|
{ "1", "menu-window" },
|
||||||
{ "2", "menu_group" },
|
{ "2", "menu-group" },
|
||||||
{ "3", "menu_cmd" },
|
{ "3", "menu-cmd" },
|
||||||
{ "M-1", "window_move" },
|
{ "M-1", "window-move" },
|
||||||
{ "CM-1", "window_grouptoggle" },
|
{ "CM-1", "window-group" },
|
||||||
{ "M-2", "window_resize" },
|
{ "M-2", "window-resize" },
|
||||||
{ "M-3", "window_lower" },
|
{ "M-3", "window-lower" },
|
||||||
{ "CMS-3", "window_hide" },
|
{ "CMS-3", "window-hide" },
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -510,6 +512,10 @@ conf_bind_key(struct conf *c, const char *bind, const char *cmd)
|
|||||||
const char *key;
|
const char *key;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
if ((strcmp(bind, "all") == 0) && (cmd == NULL)) {
|
||||||
|
conf_unbind_key_all(c);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
kb = xmalloc(sizeof(*kb));
|
kb = xmalloc(sizeof(*kb));
|
||||||
key = conf_bind_getmask(bind, &kb->modmask);
|
key = conf_bind_getmask(bind, &kb->modmask);
|
||||||
kb->press.keysym = XStringToKeysym(key);
|
kb->press.keysym = XStringToKeysym(key);
|
||||||
@ -518,12 +524,10 @@ conf_bind_key(struct conf *c, const char *bind, const char *cmd)
|
|||||||
free(kb);
|
free(kb);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
/* Remove duplicates. */
|
|
||||||
conf_unbind_key(c, kb);
|
conf_unbind_key(c, kb);
|
||||||
|
if (cmd == NULL) {
|
||||||
if (strcmp("unmap", cmd) == 0) {
|
|
||||||
free(kb);
|
free(kb);
|
||||||
return(1);
|
goto out;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nitems(name_to_func); i++) {
|
for (i = 0; i < nitems(name_to_func); i++) {
|
||||||
if (strcmp(name_to_func[i].tag, cmd) != 0)
|
if (strcmp(name_to_func[i].tag, cmd) != 0)
|
||||||
@ -532,12 +536,13 @@ conf_bind_key(struct conf *c, const char *bind, const char *cmd)
|
|||||||
kb->context = name_to_func[i].context;
|
kb->context = name_to_func[i].context;
|
||||||
kb->argument = name_to_func[i].argument;
|
kb->argument = name_to_func[i].argument;
|
||||||
TAILQ_INSERT_TAIL(&c->keybindq, kb, entry);
|
TAILQ_INSERT_TAIL(&c->keybindq, kb, entry);
|
||||||
return(1);
|
goto out;
|
||||||
}
|
}
|
||||||
kb->callback = kbfunc_exec_cmd;
|
kb->callback = kbfunc_exec_cmd;
|
||||||
kb->context = CWM_CONTEXT_NONE;
|
kb->context = CWM_CONTEXT_NONE;
|
||||||
kb->argument.c = xstrdup(cmd);
|
kb->argument.c = xstrdup(cmd);
|
||||||
TAILQ_INSERT_TAIL(&c->keybindq, kb, entry);
|
TAILQ_INSERT_TAIL(&c->keybindq, kb, entry);
|
||||||
|
out:
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,6 +563,19 @@ conf_unbind_key(struct conf *c, struct bind_ctx *unbind)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
conf_unbind_key_all(struct conf *c)
|
||||||
|
{
|
||||||
|
struct bind_ctx *key = NULL, *keynxt;
|
||||||
|
|
||||||
|
TAILQ_FOREACH_SAFE(key, &c->keybindq, entry, keynxt) {
|
||||||
|
TAILQ_REMOVE(&c->keybindq, key, entry);
|
||||||
|
if (key->context == CWM_CONTEXT_NONE)
|
||||||
|
free(key->argument.c);
|
||||||
|
free(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
conf_bind_mouse(struct conf *c, const char *bind, const char *cmd)
|
conf_bind_mouse(struct conf *c, const char *bind, const char *cmd)
|
||||||
{
|
{
|
||||||
@ -565,6 +583,10 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd)
|
|||||||
const char *button, *errstr;
|
const char *button, *errstr;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
if ((strcmp(bind, "all") == 0) && (cmd == NULL)) {
|
||||||
|
conf_unbind_mouse_all(c);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
mb = xmalloc(sizeof(*mb));
|
mb = xmalloc(sizeof(*mb));
|
||||||
button = conf_bind_getmask(bind, &mb->modmask);
|
button = conf_bind_getmask(bind, &mb->modmask);
|
||||||
mb->press.button = strtonum(button, Button1, Button5, &errstr);
|
mb->press.button = strtonum(button, Button1, Button5, &errstr);
|
||||||
@ -573,12 +595,10 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd)
|
|||||||
free(mb);
|
free(mb);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
/* Remove duplicates. */
|
|
||||||
conf_unbind_mouse(c, mb);
|
conf_unbind_mouse(c, mb);
|
||||||
|
if (cmd == NULL) {
|
||||||
if (strcmp("unmap", cmd) == 0) {
|
|
||||||
free(mb);
|
free(mb);
|
||||||
return(1);
|
goto out;
|
||||||
}
|
}
|
||||||
for (i = 0; i < nitems(name_to_func); i++) {
|
for (i = 0; i < nitems(name_to_func); i++) {
|
||||||
if (strcmp(name_to_func[i].tag, cmd) != 0)
|
if (strcmp(name_to_func[i].tag, cmd) != 0)
|
||||||
@ -587,9 +607,14 @@ conf_bind_mouse(struct conf *c, const char *bind, const char *cmd)
|
|||||||
mb->context = name_to_func[i].context;
|
mb->context = name_to_func[i].context;
|
||||||
mb->argument = name_to_func[i].argument;
|
mb->argument = name_to_func[i].argument;
|
||||||
TAILQ_INSERT_TAIL(&c->mousebindq, mb, entry);
|
TAILQ_INSERT_TAIL(&c->mousebindq, mb, entry);
|
||||||
return(1);
|
goto out;
|
||||||
}
|
}
|
||||||
return(0);
|
mb->callback = kbfunc_exec_cmd;
|
||||||
|
mb->context = CWM_CONTEXT_NONE;
|
||||||
|
mb->argument.c = xstrdup(cmd);
|
||||||
|
TAILQ_INSERT_TAIL(&c->mousebindq, mb, entry);
|
||||||
|
out:
|
||||||
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -607,6 +632,19 @@ conf_unbind_mouse(struct conf *c, struct bind_ctx *unbind)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
conf_unbind_mouse_all(struct conf *c)
|
||||||
|
{
|
||||||
|
struct bind_ctx *mb = NULL, *mbnxt;
|
||||||
|
|
||||||
|
TAILQ_FOREACH_SAFE(mb, &c->mousebindq, entry, mbnxt) {
|
||||||
|
TAILQ_REMOVE(&c->mousebindq, mb, entry);
|
||||||
|
if (mb->context == CWM_CONTEXT_NONE)
|
||||||
|
free(mb->argument.c);
|
||||||
|
free(mb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
conf_grab_kbd(Window win)
|
conf_grab_kbd(Window win)
|
||||||
{
|
{
|
||||||
|
445
cwmrc.5
445
cwmrc.5
@ -63,11 +63,15 @@ The name and class values, respectively, for existing windows
|
|||||||
are both set in the WM_CLASS property and may be obtained using
|
are both set in the WM_CLASS property and may be obtained using
|
||||||
.Xr xprop 1 .
|
.Xr xprop 1 .
|
||||||
.Pp
|
.Pp
|
||||||
.It Ic bind Ar keys command
|
.It Ic bind-key Ar key function
|
||||||
Cause the creation of a key binding, or replacement of a default
|
Bind or rebind key
|
||||||
key binding.
|
.Ar key
|
||||||
|
to
|
||||||
|
.Ar function .
|
||||||
The modifier keys come first, followed by a
|
The modifier keys come first, followed by a
|
||||||
.Sq - .
|
.Sq - ,
|
||||||
|
then a keysym name, taken from
|
||||||
|
.Pa /usr/X11R6/include/X11/keysymdef.h .
|
||||||
.Pp
|
.Pp
|
||||||
The following modifiers are recognised:
|
The following modifiers are recognised:
|
||||||
.Pp
|
.Pp
|
||||||
@ -83,22 +87,53 @@ Mod4 (windows) key.
|
|||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Sq -
|
.Ar function
|
||||||
should be followed by a keysym name, taken from
|
|
||||||
.Pa /usr/X11R6/include/X11/keysymdef.h .
|
|
||||||
The
|
|
||||||
.Ar command
|
|
||||||
may either be one from the
|
may either be one from the
|
||||||
.Sx BIND COMMAND LIST
|
.Sx BIND FUNCTION LIST
|
||||||
(see below) or the command line that is to be executed.
|
(see below) or the command line that is to be executed.
|
||||||
.Pp
|
.Pp
|
||||||
A special
|
.It Ic bind-mouse Ar button function
|
||||||
.Ar command
|
Bind or rebind button
|
||||||
keyword
|
.Ar button
|
||||||
.Dq unmap
|
to
|
||||||
can be used to remove the named key binding.
|
.Ar function .
|
||||||
This can be used to remove a binding which conflicts with an
|
The modifier keys come first, followed by a
|
||||||
application.
|
.Sq - ,
|
||||||
|
then the button number.
|
||||||
|
.Pp
|
||||||
|
The following modifiers are recognised:
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width Ds -offset indent -compact
|
||||||
|
.It Ic C
|
||||||
|
Control key.
|
||||||
|
.It Ic M
|
||||||
|
Meta key.
|
||||||
|
.It Ic S
|
||||||
|
Shift key.
|
||||||
|
.It Ic 4
|
||||||
|
Mod4 (windows) key.
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
The following buttons are recognised:
|
||||||
|
.Pp
|
||||||
|
.Bl -tag -width Ds -offset indent -compact
|
||||||
|
.It Ic 1
|
||||||
|
Left mouse button.
|
||||||
|
.It Ic 2
|
||||||
|
Middle mouse button.
|
||||||
|
.It Ic 3
|
||||||
|
Right mouse button.
|
||||||
|
.It Ic 4
|
||||||
|
Scroll up mouse button.
|
||||||
|
.It Ic 5
|
||||||
|
Scroll down mouse button.
|
||||||
|
.El
|
||||||
|
.Pp
|
||||||
|
The
|
||||||
|
.Ar function
|
||||||
|
may be taken from the
|
||||||
|
.Sx BIND FUNCTION LIST
|
||||||
|
(see below) or the command line that is to be executed.
|
||||||
.Pp
|
.Pp
|
||||||
.It Ic borderwidth Ar pixels
|
.It Ic borderwidth Ar pixels
|
||||||
Set the window border width to
|
Set the window border width to
|
||||||
@ -177,48 +212,6 @@ Ignore, and do not warp to, windows with the name
|
|||||||
.Ar windowname
|
.Ar windowname
|
||||||
when drawing borders and cycling through windows.
|
when drawing borders and cycling through windows.
|
||||||
.Pp
|
.Pp
|
||||||
.It Ic mousebind Ar buttons command
|
|
||||||
Cause the creation of a mouse binding, or replacement of a default
|
|
||||||
mouse binding.
|
|
||||||
The modifier keys come first, followed by a
|
|
||||||
.Sq - .
|
|
||||||
.Pp
|
|
||||||
The following modifiers are recognised:
|
|
||||||
.Pp
|
|
||||||
.Bl -tag -width Ds -offset indent -compact
|
|
||||||
.It Ic C
|
|
||||||
Control key.
|
|
||||||
.It Ic M
|
|
||||||
Meta key.
|
|
||||||
.It Ic S
|
|
||||||
Shift key.
|
|
||||||
.It Ic 4
|
|
||||||
Mod4 (windows) key.
|
|
||||||
.El
|
|
||||||
.Pp
|
|
||||||
The
|
|
||||||
.Sq -
|
|
||||||
should be followed by number:
|
|
||||||
.Pp
|
|
||||||
.Bl -tag -width Ds -offset indent -compact
|
|
||||||
.It Ic 1
|
|
||||||
Left mouse button.
|
|
||||||
.It Ic 2
|
|
||||||
Middle mouse button.
|
|
||||||
.It Ic 3
|
|
||||||
Right mouse button.
|
|
||||||
.It Ic 4
|
|
||||||
Scroll up mouse button.
|
|
||||||
.It Ic 5
|
|
||||||
Scroll down mouse button.
|
|
||||||
.El
|
|
||||||
.Pp
|
|
||||||
The
|
|
||||||
.Ar command
|
|
||||||
may be taken from the
|
|
||||||
.Sx MOUSEBIND COMMAND LIST
|
|
||||||
(see below).
|
|
||||||
.Pp
|
|
||||||
.It Ic moveamount Ar pixels
|
.It Ic moveamount Ar pixels
|
||||||
Set a default size for the keyboard movement bindings,
|
Set a default size for the keyboard movement bindings,
|
||||||
in pixels.
|
in pixels.
|
||||||
@ -234,9 +227,28 @@ The default behavior for new windows is to not assign any group.
|
|||||||
By enabling sticky group mode,
|
By enabling sticky group mode,
|
||||||
.Xr cwm 1
|
.Xr cwm 1
|
||||||
will assign new windows to the currently selected group.
|
will assign new windows to the currently selected group.
|
||||||
|
.Pp
|
||||||
|
.It Ic unbind-key Ar key
|
||||||
|
Unbind function bound to
|
||||||
|
.Ar key .
|
||||||
|
A special
|
||||||
|
.Ar key
|
||||||
|
keyword
|
||||||
|
.Dq all
|
||||||
|
can be used to unbind all keys.
|
||||||
|
.Pp
|
||||||
|
.It Ic unbind-mouse Ar button
|
||||||
|
Unbind function bound to
|
||||||
|
.Ar button .
|
||||||
|
A special
|
||||||
|
.Ar button
|
||||||
|
keyword
|
||||||
|
.Dq all
|
||||||
|
can be used to unbind all buttons.
|
||||||
|
.Pp
|
||||||
.El
|
.El
|
||||||
.Sh BIND COMMAND LIST
|
.Sh BIND FUNCTION LIST
|
||||||
.Bl -tag -width 18n -compact
|
.Bl -tag -width 23n -compact
|
||||||
.It restart
|
.It restart
|
||||||
Restart the running
|
Restart the running
|
||||||
.Xr cwm 1 .
|
.Xr cwm 1 .
|
||||||
@ -247,197 +259,174 @@ Quit
|
|||||||
Spawn a new terminal.
|
Spawn a new terminal.
|
||||||
.It lock
|
.It lock
|
||||||
Lock the screen.
|
Lock the screen.
|
||||||
.It search
|
.It menu-window
|
||||||
Launch window search menu.
|
Launch window search menu.
|
||||||
.It menusearch
|
.It menu-cmd
|
||||||
Launch application search menu.
|
Launch application search menu.
|
||||||
.It groupsearch
|
.It menu-group
|
||||||
Launch group search menu.
|
Launch group search menu.
|
||||||
.It exec
|
.It menu-exec
|
||||||
Launch
|
Launch
|
||||||
.Dq exec program
|
.Dq exec program
|
||||||
menu.
|
menu.
|
||||||
.It exec_wm
|
.It menu-exec-wm
|
||||||
Launch
|
Launch
|
||||||
.Dq exec WindowManager
|
.Dq exec WindowManager
|
||||||
menu.
|
menu.
|
||||||
.It ssh
|
.It menu-ssh
|
||||||
Launch
|
Launch
|
||||||
.Dq ssh
|
.Dq ssh
|
||||||
menu.
|
menu.
|
||||||
.It group[n]
|
.It group-toggle-[n]
|
||||||
Toggle visibility of group n, where n is 1-9.
|
Toggle visibility of group n, where n is 1-9.
|
||||||
.It grouponly[n]
|
.It group-only-[n]
|
||||||
Like
|
Show only group n, where n is 1-9, hiding other groups.
|
||||||
.Ar group[n]
|
.It window-toggle-all
|
||||||
but also hides the other groups.
|
|
||||||
.It nogroup
|
|
||||||
Toggle visibility of all groups.
|
Toggle visibility of all groups.
|
||||||
.It grouptoggle
|
.It window-group
|
||||||
Toggle group membership of current window.
|
Toggle group membership of current window.
|
||||||
.It movetogroup[n]
|
.It window-movetogroup-[n]
|
||||||
Hide current window from display and move to group n, where n is 1-9.
|
Hide current window from display and move to group n, where n is 1-9.
|
||||||
.It cyclegroup
|
.It group-cycle
|
||||||
Forward cycle through groups.
|
Forward cycle through groups.
|
||||||
.It rcyclegroup
|
.It group-rcycle
|
||||||
Reverse cycle through groups.
|
Reverse cycle through groups.
|
||||||
.It cycle
|
.It window-cycle
|
||||||
Forward cycle through windows.
|
Forward cycle through windows.
|
||||||
.It rcycle
|
.It window-rcycle
|
||||||
Reverse cycle through windows.
|
Reverse cycle through windows.
|
||||||
.It cycleingroup
|
.It window-cycle-ingroup
|
||||||
Forward cycle through windows in current group.
|
Forward cycle through windows in current group.
|
||||||
.It rcycleingroup
|
.It window-rcycle-ingroup
|
||||||
Reverse cycle through windows in current group.
|
Reverse cycle through windows in current group.
|
||||||
.It delete
|
.It window-delete
|
||||||
Delete current window.
|
Delete current window.
|
||||||
.It hide
|
.It window-hide
|
||||||
Hide current window.
|
Hide current window.
|
||||||
.It lower
|
.It window-lower
|
||||||
Lower current window.
|
Lower current window.
|
||||||
.It raise
|
.It window-raise
|
||||||
Raise current window.
|
Raise current window.
|
||||||
.It label
|
.It window-menu-label
|
||||||
Label current window.
|
Label current window.
|
||||||
.It freeze
|
.It window-freeze
|
||||||
Freeze current window geometry.
|
Freeze current window geometry.
|
||||||
.It stick
|
.It window-stick
|
||||||
Stick current window to all groups (same as assigning to nogroup).
|
Stick current window to all groups (same as assigning to nogroup).
|
||||||
.It fullscreen
|
.It window-fullscreen
|
||||||
Full-screen current window (gap + border removed).
|
Full-screen current window (gap + border removed).
|
||||||
.It maximize
|
.It window-maximize
|
||||||
Maximize current window (gap + border honored).
|
Maximize current window (gap + border honored).
|
||||||
.It vmaximize
|
.It window-vmaximize
|
||||||
Vertically maximize current window (gap + border honored).
|
Vertically maximize current window (gap + border honored).
|
||||||
.It hmaximize
|
.It window-hmaximize
|
||||||
Horizontally maximize current window (gap + border honored).
|
Horizontally maximize current window (gap + border honored).
|
||||||
.It moveup
|
.It window-htile
|
||||||
Move window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It movedown
|
|
||||||
Move window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It moveright
|
|
||||||
Move window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It moveleft
|
|
||||||
Move window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It bigmoveup
|
|
||||||
Move window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It bigmovedown
|
|
||||||
Move window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It bigmoveright
|
|
||||||
Move window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It bigmoveleft
|
|
||||||
Move window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It resizeup
|
|
||||||
Resize window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It resizedown
|
|
||||||
Resize window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It resizeright
|
|
||||||
Resize window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It resizeleft
|
|
||||||
Resize window
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It bigresizeup
|
|
||||||
Resize window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It bigresizedown
|
|
||||||
Resize window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It bigresizeright
|
|
||||||
Resize window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It bigresizeleft
|
|
||||||
Resize window 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It ptrmoveup
|
|
||||||
Move pointer
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It ptrmovedown
|
|
||||||
Move pointer
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It ptrmoveright
|
|
||||||
Move pointer
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It ptrmoveleft
|
|
||||||
Move pointer
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It bigptrmoveup
|
|
||||||
Move pointer 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels up.
|
|
||||||
.It bigptrmovedown
|
|
||||||
Move pointer 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels down.
|
|
||||||
.It bigptrmoveright
|
|
||||||
Move pointer 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels right.
|
|
||||||
.It bigptrmoveleft
|
|
||||||
Move pointer 10 times
|
|
||||||
.Ar moveamount
|
|
||||||
pixels left.
|
|
||||||
.It htile
|
|
||||||
Current window is placed at the top of the screen and maximized
|
Current window is placed at the top of the screen and maximized
|
||||||
horizontally, other windows in its group share remaining screen space.
|
horizontally, other windows in its group share remaining screen space.
|
||||||
.It vtile
|
.It window-vtile
|
||||||
Current window is placed on the left of the screen and maximized
|
Current window is placed on the left of the screen and maximized
|
||||||
vertically, other windows in its group share remaining screen space.
|
vertically, other windows in its group share remaining screen space.
|
||||||
.El
|
.It window-move
|
||||||
.Sh MOUSEBIND COMMAND LIST
|
|
||||||
.Bl -tag -width 18n -compact
|
|
||||||
.It window_move
|
|
||||||
Move current window.
|
Move current window.
|
||||||
.It window_resize
|
.It window-resize
|
||||||
Resize current window.
|
Resize current window.
|
||||||
.It window_lower
|
.It window-move-up
|
||||||
Lower current window.
|
Move window
|
||||||
.It window_raise
|
.Ar moveamount
|
||||||
Raise current window.
|
pixels up.
|
||||||
.It window_hide
|
.It window-move-down
|
||||||
Hide current window.
|
Move window
|
||||||
.It window_grouptoggle
|
.Ar moveamount
|
||||||
Toggle group membership of current window.
|
pixels down.
|
||||||
.It cyclegroup
|
.It window-move-right
|
||||||
Forward cycle through groups.
|
Move window
|
||||||
.It rcyclegroup
|
.Ar moveamount
|
||||||
Reverse cycle through groups.
|
pixels right.
|
||||||
.It menu_group
|
.It window-move-left
|
||||||
Launch group list.
|
Move window
|
||||||
.It menu_unhide
|
.Ar moveamount
|
||||||
Launch hidden window list.
|
pixels left.
|
||||||
.It menu_cmd
|
.It window-move-up-big
|
||||||
Launch command list.
|
Move window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels up.
|
||||||
|
.It window-move-down-big
|
||||||
|
Move window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels down.
|
||||||
|
.It window-move-right-big
|
||||||
|
Move window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels right.
|
||||||
|
.It window-move-left-big
|
||||||
|
Move window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels left.
|
||||||
|
.It window-resize-up
|
||||||
|
Resize window
|
||||||
|
.Ar moveamount
|
||||||
|
pixels up.
|
||||||
|
.It window-resize-down
|
||||||
|
Resize window
|
||||||
|
.Ar moveamount
|
||||||
|
pixels down.
|
||||||
|
.It window-resize-right
|
||||||
|
Resize window
|
||||||
|
.Ar moveamount
|
||||||
|
pixels right.
|
||||||
|
.It window-resize-left
|
||||||
|
Resize window
|
||||||
|
.Ar moveamount
|
||||||
|
pixels left.
|
||||||
|
.It window-resize-up-big
|
||||||
|
Resize window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels up.
|
||||||
|
.It window-resize-down-big
|
||||||
|
Resize window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels down.
|
||||||
|
.It window-resize-right-big
|
||||||
|
Resize window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels right.
|
||||||
|
.It window-resize-left-big
|
||||||
|
Resize window 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels left.
|
||||||
|
.It pointer-move-up
|
||||||
|
Move pointer
|
||||||
|
.Ar moveamount
|
||||||
|
pixels up.
|
||||||
|
.It pointer-move-down
|
||||||
|
Move pointer
|
||||||
|
.Ar moveamount
|
||||||
|
pixels down.
|
||||||
|
.It pointer-move-right
|
||||||
|
Move pointer
|
||||||
|
.Ar moveamount
|
||||||
|
pixels right.
|
||||||
|
.It pointer-move-left
|
||||||
|
Move pointer
|
||||||
|
.Ar moveamount
|
||||||
|
pixels left.
|
||||||
|
.It pointer-move-up-big
|
||||||
|
Move pointer 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels up.
|
||||||
|
.It pointer-move-down-big
|
||||||
|
Move pointer 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels down.
|
||||||
|
.It pointer-move-right-big
|
||||||
|
Move pointer 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels right.
|
||||||
|
.It pointer-move-left-big
|
||||||
|
Move pointer 10 times
|
||||||
|
.Ar moveamount
|
||||||
|
pixels left.
|
||||||
.El
|
.El
|
||||||
.Sh FILES
|
.Sh FILES
|
||||||
.Bl -tag -width "~/.cwmrcXXX" -compact
|
.Bl -tag -width "~/.cwmrcXXX" -compact
|
||||||
@ -470,23 +459,23 @@ ignore xapm
|
|||||||
ignore xclock
|
ignore xclock
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
bind CM-r label
|
bind-key CM-r window-menu-label
|
||||||
bind CS-Return "xterm -e top"
|
bind-key CS-Return "xterm -e top"
|
||||||
bind 4-o unmap
|
bind-key C4-equal window-vmaximize
|
||||||
bind CM-equal unmap
|
bind-key C4S-equal window-hmaximize
|
||||||
bind CMS-equal unmap
|
bind-key M-1 group-only-1
|
||||||
bind C4-equal vmaximize
|
bind-key M-2 group-only-2
|
||||||
bind C4S-equal hmaximize
|
bind-key M-3 group-only-3
|
||||||
bind M-1 grouponly1
|
bind-key MS-1 window-movetogroup-1
|
||||||
bind M-2 grouponly2
|
bind-key MS-2 window-movetogroup-2
|
||||||
bind M-3 grouponly3
|
bind-key MS-3 window-movetogroup-3
|
||||||
bind MS-1 movetogroup1
|
unbind-key 4-o
|
||||||
bind MS-2 movetogroup2
|
unbind-key CM-equal
|
||||||
bind MS-3 movetogroup3
|
unbind-key CMS-equal
|
||||||
|
|
||||||
# Mouse bindings
|
# Mouse bindings
|
||||||
mousebind M-2 window_lower
|
bind-mouse M-2 window-lower
|
||||||
mousebind M-3 window_resize
|
bind-mouse M-3 window-resize
|
||||||
.Ed
|
.Ed
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr cwm 1
|
.Xr cwm 1
|
||||||
|
53
parse.y
53
parse.y
@ -68,8 +68,9 @@ typedef struct {
|
|||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%token FONTNAME STICKY GAP MOUSEBIND
|
%token BINDKEY UNBINDKEY BINDMOUSE UNBINDMOUSE
|
||||||
%token AUTOGROUP BIND COMMAND IGNORE
|
%token FONTNAME STICKY GAP
|
||||||
|
%token AUTOGROUP COMMAND IGNORE
|
||||||
%token YES NO BORDERWIDTH MOVEAMOUNT
|
%token YES NO BORDERWIDTH MOVEAMOUNT
|
||||||
%token COLOR SNAPDIST
|
%token COLOR SNAPDIST
|
||||||
%token ACTIVEBORDER INACTIVEBORDER URGENCYBORDER
|
%token ACTIVEBORDER INACTIVEBORDER URGENCYBORDER
|
||||||
@ -169,16 +170,6 @@ main : FONTNAME STRING {
|
|||||||
conf_ignore(conf, $2);
|
conf_ignore(conf, $2);
|
||||||
free($2);
|
free($2);
|
||||||
}
|
}
|
||||||
| BIND STRING string {
|
|
||||||
if (!conf_bind_key(conf, $2, $3)) {
|
|
||||||
yyerror("invalid bind: %s %s", $2, $3);
|
|
||||||
free($2);
|
|
||||||
free($3);
|
|
||||||
YYERROR;
|
|
||||||
}
|
|
||||||
free($2);
|
|
||||||
free($3);
|
|
||||||
}
|
|
||||||
| GAP NUMBER NUMBER NUMBER NUMBER {
|
| GAP NUMBER NUMBER NUMBER NUMBER {
|
||||||
if ($2 < 0 || $2 > INT_MAX ||
|
if ($2 < 0 || $2 > INT_MAX ||
|
||||||
$3 < 0 || $3 > INT_MAX ||
|
$3 < 0 || $3 > INT_MAX ||
|
||||||
@ -192,9 +183,9 @@ main : FONTNAME STRING {
|
|||||||
conf->gap.left = $4;
|
conf->gap.left = $4;
|
||||||
conf->gap.right = $5;
|
conf->gap.right = $5;
|
||||||
}
|
}
|
||||||
| MOUSEBIND STRING string {
|
| BINDKEY STRING string {
|
||||||
if (!conf_bind_mouse(conf, $2, $3)) {
|
if (!conf_bind_key(conf, $2, $3)) {
|
||||||
yyerror("invalid mousebind: %s %s", $2, $3);
|
yyerror("invalid bind-key: %s %s", $2, $3);
|
||||||
free($2);
|
free($2);
|
||||||
free($3);
|
free($3);
|
||||||
YYERROR;
|
YYERROR;
|
||||||
@ -202,6 +193,32 @@ main : FONTNAME STRING {
|
|||||||
free($2);
|
free($2);
|
||||||
free($3);
|
free($3);
|
||||||
}
|
}
|
||||||
|
| UNBINDKEY STRING {
|
||||||
|
if (!conf_bind_key(conf, $2, NULL)) {
|
||||||
|
yyerror("invalid unbind-key: %s", $2);
|
||||||
|
free($2);
|
||||||
|
YYERROR;
|
||||||
|
}
|
||||||
|
free($2);
|
||||||
|
}
|
||||||
|
| BINDMOUSE STRING string {
|
||||||
|
if (!conf_bind_mouse(conf, $2, $3)) {
|
||||||
|
yyerror("invalid bind-mouse: %s %s", $2, $3);
|
||||||
|
free($2);
|
||||||
|
free($3);
|
||||||
|
YYERROR;
|
||||||
|
}
|
||||||
|
free($2);
|
||||||
|
free($3);
|
||||||
|
}
|
||||||
|
| UNBINDMOUSE STRING {
|
||||||
|
if (!conf_bind_mouse(conf, $2, NULL)) {
|
||||||
|
yyerror("invalid unbind-mouse: %s", $2);
|
||||||
|
free($2);
|
||||||
|
YYERROR;
|
||||||
|
}
|
||||||
|
free($2);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
color : COLOR colors
|
color : COLOR colors
|
||||||
@ -278,7 +295,8 @@ lookup(char *s)
|
|||||||
static const struct keywords keywords[] = {
|
static const struct keywords keywords[] = {
|
||||||
{ "activeborder", ACTIVEBORDER},
|
{ "activeborder", ACTIVEBORDER},
|
||||||
{ "autogroup", AUTOGROUP},
|
{ "autogroup", AUTOGROUP},
|
||||||
{ "bind", BIND},
|
{ "bind-key", BINDKEY},
|
||||||
|
{ "bind-mouse", BINDMOUSE},
|
||||||
{ "borderwidth", BORDERWIDTH},
|
{ "borderwidth", BORDERWIDTH},
|
||||||
{ "color", COLOR},
|
{ "color", COLOR},
|
||||||
{ "command", COMMAND},
|
{ "command", COMMAND},
|
||||||
@ -290,12 +308,13 @@ lookup(char *s)
|
|||||||
{ "inactiveborder", INACTIVEBORDER},
|
{ "inactiveborder", INACTIVEBORDER},
|
||||||
{ "menubg", MENUBG},
|
{ "menubg", MENUBG},
|
||||||
{ "menufg", MENUFG},
|
{ "menufg", MENUFG},
|
||||||
{ "mousebind", MOUSEBIND},
|
|
||||||
{ "moveamount", MOVEAMOUNT},
|
{ "moveamount", MOVEAMOUNT},
|
||||||
{ "no", NO},
|
{ "no", NO},
|
||||||
{ "selfont", FONTSELCOLOR},
|
{ "selfont", FONTSELCOLOR},
|
||||||
{ "snapdist", SNAPDIST},
|
{ "snapdist", SNAPDIST},
|
||||||
{ "sticky", STICKY},
|
{ "sticky", STICKY},
|
||||||
|
{ "unbind-key", UNBINDKEY},
|
||||||
|
{ "unbind-mouse", UNBINDMOUSE},
|
||||||
{ "ungroupborder", UNGROUPBORDER},
|
{ "ungroupborder", UNGROUPBORDER},
|
||||||
{ "urgencyborder", URGENCYBORDER},
|
{ "urgencyborder", URGENCYBORDER},
|
||||||
{ "yes", YES}
|
{ "yes", YES}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user