diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-02-07 21:07:01 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-02-07 21:07:01 +0000 |
commit | 42101f69c9f47be0c3b7d1b191ccf816cedca08f (patch) | |
tree | 882ac6d4c11bfa0d22955235eec5459f1159b0e0 /app/cwm | |
parent | 3661c91cb20d6b3068d82c2ceb32e4bfb7038eae (diff) |
add 'moveamount' to cwmrc; it sets keyboard movement amount, making
it more useful on large screens
manpage tweak & ok jmc@
ok okan@, oga@
Diffstat (limited to 'app/cwm')
-rw-r--r-- | app/cwm/calmwm.h | 4 | ||||
-rw-r--r-- | app/cwm/conf.c | 3 | ||||
-rw-r--r-- | app/cwm/cwmrc.5 | 107 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 5 | ||||
-rw-r--r-- | app/cwm/parse.y | 9 |
5 files changed, 94 insertions, 34 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index e02b174ba..36ef77bce 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: calmwm.h,v 1.82 2009/01/27 02:16:20 okan Exp $ + * $Id: calmwm.h,v 1.83 2009/02/07 21:07:00 martynas Exp $ */ #ifndef _CALMWM_H_ @@ -256,6 +256,8 @@ struct conf { int flags; #define CONF_BWIDTH 1 int bwidth; +#define CONF_MAMOUNT 1 + int mamount; char termpath[MAXPATHLEN]; char lockpath[MAXPATHLEN]; diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 554748c2e..940d7cee8 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: conf.c,v 1.56 2009/01/23 20:47:45 okan Exp $ + * $Id: conf.c,v 1.57 2009/02/07 21:07:00 martynas Exp $ */ #include "headers.h" @@ -77,6 +77,7 @@ conf_init(struct conf *c) { c->flags = 0; c->bwidth = CONF_BWIDTH; + c->mamount = CONF_MAMOUNT; TAILQ_INIT(&c->ignoreq); TAILQ_INIT(&c->cmdq); diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5 index 3d85a12dc..18b89444b 100644 --- a/app/cwm/cwmrc.5 +++ b/app/cwm/cwmrc.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cwmrc.5,v 1.19 2009/02/07 16:59:11 martynas Exp $ +.\" $OpenBSD: cwmrc.5,v 1.20 2009/02/07 21:07:00 martynas Exp $ .\" .\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org> .\" @@ -34,7 +34,7 @@ properties, where .Ar group is a number between 0 and 9. If the group number is 0, then the window will not be grouped; this to -allow for +allow for .Dq sticky windows in sticky group mode. .Pp @@ -139,7 +139,7 @@ The modifier keys come first, followed by a The following modifiers are recognised: .Pp .Bl -tag -width Ds -offset indent -compact -.It C +.It C The Control key. .It M The Meta key. @@ -169,6 +169,11 @@ may be taken from the .Sx MOUSEBIND COMMAND LIST (see below). .Pp +.It Ic moveamount Ar pixels +Set a default size for the keyboard movement bindings, +in pixels. +The default is 1. +.Pp .It Ic sticky Ic yes Ns \&| Ns Ic no Toggle sticky group mode. The default behavior for new windows is to not assign any group. @@ -264,53 +269,101 @@ Maximize current window full-screen. .It vmaximize Maximize current window vertically. .It moveup -Move window 1 pixel up. +Move window +.Ar moveamount +pixels up. .It movedown -Move window 1 pixel down. +Move window +.Ar moveamount +pixels down. .It moveright -Move window 1 pixel right. +Move window +.Ar moveamount +pixels right. .It moveleft -Move window 1 pixel left. +Move window +.Ar moveamount +pixels left. .It bigmoveup -Move window 10 pixels up. +Move window 10 times +.Ar moveamount +pixels up. .It bigmovedown -Move window 10 pixels down. +Move window 10 times +.Ar moveamount +pixels down. .It bigmoveright -Move window 10 pixels right. +Move window 10 times +.Ar moveamount +pixels right. .It bigmoveleft -Move window 10 pixels left. +Move window 10 times +.Ar moveamount +pixels left. .It resizeup -Resize window 1 pixel up. +Resize window +.Ar moveamount +pixels up. .It resizedown -Resize window 1 pixel down. +Resize window +.Ar moveamount +pixels down. .It resizeright -Resize window 1 pixel right. +Resize window +.Ar moveamount +pixels right. .It resizeleft -Resize window 1 pixel left. +Resize window +.Ar moveamount +pixels left. .It bigresizeup -Resize window 10 pixels up. +Resize window 10 times +.Ar moveamount +pixels up. .It bigresizedown -Resize window 10 pixels down. +Resize window 10 times +.Ar moveamount +pixels down. .It bigresizeright -Resize window 10 pixels right. +Resize window 10 times +.Ar moveamount +pixels right. .It bigresizeleft -Resize window 10 pixels left. +Resize window 10 times +.Ar moveamount +pixels left. .It ptrmoveup -Move pointer 1 pixel up. +Move pointer +.Ar moveamount +pixels up. .It ptrmovedown -Move pointer 1 pixel down. +Move pointer +.Ar moveamount +pixels down. .It ptrmoveright -Move pointer 1 pixel right. +Move pointer +.Ar moveamount +pixels right. .It ptrmoveleft -Move pointer 1 pixel left. +Move pointer +.Ar moveamount +pixels left. .It bigptrmoveup -Move pointer 10 pixels up. +Move pointer 10 times +.Ar moveamount +pixels up. .It bigptrmovedown -Move pointer 10 pixels down. +Move pointer 10 times +.Ar moveamount +pixels down. .It bigptrmoveright -Move pointer 10 pixels right. +Move pointer 10 times +.Ar moveamount +pixels right. .It bigptrmoveleft -Move pointer 10 pixels left. +Move pointer 10 times +.Ar moveamount +pixels left. .El .Sh MOUSEBIND COMMAND LIST .Bl -tag -width 18n -compact diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 1be5a80ef..48eea820f 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: kbfunc.c,v 1.35 2009/02/03 22:20:31 martynas Exp $ + * $Id: kbfunc.c,v 1.36 2009/02/07 21:07:00 martynas Exp $ */ #include <paths.h> @@ -25,7 +25,6 @@ #define KNOWN_HOSTS ".ssh/known_hosts" #define HASH_MARKER "|1|" -#define MOVE_AMOUNT 1 extern int _xev_quit; @@ -54,7 +53,7 @@ kbfunc_moveresize(struct client_ctx *cc, union arg *arg) mx = my = 0; flags = arg->i; - amt = MOVE_AMOUNT; + amt = Conf.mamount; if (flags & CWM_BIGMOVE) { flags -= CWM_BIGMOVE; diff --git a/app/cwm/parse.y b/app/cwm/parse.y index 34db55029..53a2a6d8e 100644 --- a/app/cwm/parse.y +++ b/app/cwm/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.18 2009/01/23 19:00:59 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.19 2009/02/07 21:07:00 martynas Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -66,7 +66,7 @@ typedef struct { %token FONTNAME STICKY GAP MOUSEBIND %token AUTOGROUP BIND COMMAND IGNORE -%token YES NO BORDERWIDTH +%token YES NO BORDERWIDTH MOVEAMOUNT %token ERROR %token <v.string> STRING %token <v.number> NUMBER @@ -110,6 +110,9 @@ main : FONTNAME STRING { | BORDERWIDTH NUMBER { conf->bwidth = $2; } + | MOVEAMOUNT NUMBER { + conf->mamount = $2; + } | COMMAND STRING string { conf_cmd_add(conf, $3, $2, 0); free($2); @@ -207,6 +210,7 @@ lookup(char *s) { "gap", GAP}, { "ignore", IGNORE}, { "mousebind", MOUSEBIND}, + { "moveamount", MOVEAMOUNT}, { "no", NO}, { "sticky", STICKY}, { "yes", YES} @@ -499,6 +503,7 @@ parse_config(const char *filename, struct conf *xconf) xconf->flags = conf->flags; xconf->bwidth = conf->bwidth; + xconf->mamount = conf->mamount; while ((cmd = TAILQ_FIRST(&conf->cmdq)) != NULL) { TAILQ_REMOVE(&conf->cmdq, cmd, entry); |