From 2cc69c661a1ffb9a7de17e1a58657701edda41a6 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 7 Dec 2017 16:25:33 +0000 Subject: Original idea from Dimitris Papastamos to move windows to corners a while ago; re-proposed by Julien Steinhauser with an updated diff. Apparently this was in the original calmnwm. However, expand the original idea and let clients 'snap' to edges instead, neatly allowing key bindings that snap to adjacent edges (i.e. corners) as well. No default bindings assigned. --- conf.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 1405f20..d0b4503 100644 --- a/conf.c +++ b/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. * - * $OpenBSD: conf.c,v 1.234 2017/12/07 15:47:14 okan Exp $ + * $OpenBSD: conf.c,v 1.235 2017/12/07 16:25:33 okan Exp $ */ #include @@ -92,6 +92,24 @@ static const struct { { "window-movetogroup-8", kbfunc_client_movetogroup, CWM_CONTEXT_CC, 8 }, { "window-movetogroup-9", kbfunc_client_movetogroup, CWM_CONTEXT_CC, 9 }, + { "window-snap-up", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_UP) }, + { "window-snap-down", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_DOWN) }, + { "window-snap-left", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_LEFT) }, + { "window-snap-right", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_RIGHT) }, + + { "window-snap-up-right", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_UP|CWM_RIGHT) }, + { "window-snap-up-left", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_UP|CWM_LEFT) }, + { "window-snap-down-right", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_DOWN|CWM_RIGHT) }, + { "window-snap-down-left", kbfunc_client_snap, CWM_CONTEXT_CC, + (CWM_DOWN|CWM_LEFT) }, + { "window-move", kbfunc_client_move, CWM_CONTEXT_CC, 0 }, { "window-move-up", kbfunc_client_move, CWM_CONTEXT_CC, (CWM_UP) }, -- cgit v1.2.3-2-gb3c3