[dwm] move/resize keyboard control

From: Claudio <smoppy_AT_gmail.com>
Date: Thu, 25 Sep 2008 19:36:33 +0200

Hi to all dwm users,
   i was trying to get the moveresize patch from this page[0] but it seems
to
point to a server which is not up anymore. Since i really need such feature
i
replaced the old code with my own:

 static void
 moveresize(const Arg *arg)
 {
    int x, y, w, h;

    if( ! (sel && arg && arg->v) )
       return;

    sscanf(arg->v, "%d%d%d%d", &x, &y, &w, &h);

    x = (x ? x + sel->x : sel->x);
    y = (y ? y + sel->y : sel->y);
    w = (w ? w + sel->w : sel->w);
    h = (h ? h + sel->h : sel->h);

    resize(sel, x, y, w, h, resizehints);

 } /* moveresize() */

Here is the key bindings part:

 { MODKEY, XK_Down, moveresize, {.v = "0 25 0
0"} },
 { MODKEY, XK_Up, moveresize, {.v = "0 -25 0
0"} },
 { MODKEY, XK_Right, moveresize, {.v = "25 0 0
0"} },
 { MODKEY, XK_Left, moveresize, {.v = "-25 0 0
0"} },
 { MODKEY|ShiftMask, XK_Down, moveresize, {.v = "0 0 0
25"} },
 { MODKEY|ShiftMask, XK_Up, moveresize, {.v = "0 0 0
-25"} },
 { MODKEY|ShiftMask, XK_Right, moveresize, {.v = "0 0 25
0"} },
 { MODKEY|ShiftMask, XK_Left, moveresize, {.v = "0 0 -25
0"} },

That's exactly what i need. Hope someone else will found it useful.

[0] http://www.suckless.org/dwm/patches/moveresize.html

Saluti,
Claudio M. Alessi
Received on Thu Sep 25 2008 - 17:36:33 UTC

This archive was generated by hypermail 2.2.0 : Thu Sep 25 2008 - 17:48:03 UTC