mfwm

A tiling fork of dylanaraps sowm.
git clone git://depsterr.com/git/mfwm
Log | Files | Refs | README | LICENSE

commit 53e12d919504acc40a9cc8e0ea90d3f75aa48b14
parent 6f6b77783e888188342ef4124b9c237870bfadfa
Author: depsterr <depsterr@protonmail.com>
Date:   Wed, 17 Jun 2020 01:11:08 +0000

made more like dwm fibonacci layout

Diffstat:
MMakefile | 15++++++---------
Dconfig.def.h | 49-------------------------------------------------
Amfwm | 0
Amfwm.c | 325+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amfwm.h | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsowm.c | 348-------------------------------------------------------------------------------
Dsowm.h | 61-------------------------------------------------------------
7 files changed, 390 insertions(+), 467 deletions(-)

diff --git a/Makefile b/Makefile @@ -4,19 +4,16 @@ PREFIX ?= /usr BINDIR ?= $(PREFIX)/bin CC ?= gcc -all: config.h sowm +all: config.h mfwm -config.h: - cp config.def.h config.h - -sowm: - $(CC) -O3 $(CFLAGS) -o sowm sowm.c -lX11 $(LDFLAGS) +mfwm: + $(CC) -O3 $(CFLAGS) -o mfwm mfwm.c -lX11 $(LDFLAGS) install: clean all - install -Dm755 sowm $(DESTDIR)$(BINDIR)/sowm + install -Dm755 mfwm $(DESTDIR)$(BINDIR)/mfwm uninstall: - rm -f $(DESTDIR)$(BINDIR)/sowm + rm -f $(DESTDIR)$(BINDIR)/mfwm clean: - rm -f sowm *.o + rm -f mfwm *.o diff --git a/config.def.h b/config.def.h @@ -1,49 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define MOD Mod4Mask - -const char* menu[] = {"dmenu_run", 0}; -const char* term[] = {"st", 0}; -const char* scrot[] = {"scr", 0}; -const char* briup[] = {"bri", "10", "+", 0}; -const char* bridown[] = {"bri", "10", "-", 0}; -const char* voldown[] = {"amixer", "sset", "Master", "5%-", 0}; -const char* volup[] = {"amixer", "sset", "Master", "5%+", 0}; -const char* volmute[] = {"amixer", "sset", "Master", "toggle", 0}; -const char* colors[] = {"bud", "/home/goldie/Pictures/Wallpapers", 0}; - -static struct key keys[] = { - {MOD, XK_q, win_kill, {0}}, - {MOD, XK_c, win_center, {0}}, - {MOD, XK_f, win_fs, {0}}, - - {Mod1Mask, XK_Tab, win_next, {0}}, - {Mod1Mask|ShiftMask, XK_Tab, win_prev, {0}}, - - {MOD, XK_d, run, {.com = menu}}, - {MOD, XK_w, run, {.com = colors}}, - {MOD, XK_p, run, {.com = scrot}}, - {MOD, XK_Return, run, {.com = term}}, - - {0, XF86XK_AudioLowerVolume, run, {.com = voldown}}, - {0, XF86XK_AudioRaiseVolume, run, {.com = volup}}, - {0, XF86XK_AudioMute, run, {.com = volmute}}, - {0, XF86XK_MonBrightnessUp, run, {.com = briup}}, - {0, XF86XK_MonBrightnessDown, run, {.com = bridown}}, - - {MOD, XK_1, ws_go, {.i = 1}}, - {MOD|ShiftMask, XK_1, win_to_ws, {.i = 1}}, - {MOD, XK_2, ws_go, {.i = 2}}, - {MOD|ShiftMask, XK_2, win_to_ws, {.i = 2}}, - {MOD, XK_3, ws_go, {.i = 3}}, - {MOD|ShiftMask, XK_3, win_to_ws, {.i = 3}}, - {MOD, XK_4, ws_go, {.i = 4}}, - {MOD|ShiftMask, XK_4, win_to_ws, {.i = 4}}, - {MOD, XK_5, ws_go, {.i = 5}}, - {MOD|ShiftMask, XK_5, win_to_ws, {.i = 5}}, - {MOD, XK_6, ws_go, {.i = 6}}, - {MOD|ShiftMask, XK_6, win_to_ws, {.i = 6}}, -}; - -#endif diff --git a/mfwm b/mfwm Binary files differ. diff --git a/mfwm.c b/mfwm.c @@ -0,0 +1,325 @@ +// sowm - An itsy bitsy floating window manager. + +#include <X11/Xlib.h> +#include <X11/XF86keysym.h> +#include <X11/keysym.h> +#include <X11/XKBlib.h> +#include <stdlib.h> +#include <signal.h> +#include <unistd.h> +#include <stdio.h> + +#include "mfwm.h" + +static client *list = {0}, *ws_list[10] = {0}, *cur; +static int ws = 1, sw, sh, wx, wy, numlock = 0; +static unsigned int ww, wh; + +const int g = 10; +static float fact = 0.5f; + +static Display *d; +static Window root; + +static void (*events[LASTEvent])(XEvent *e) = { + [KeyPress] = key_press, + [MapRequest] = map_request, + [DestroyNotify] = notify_destroy, + [EnterNotify] = notify_enter, +}; + +#include "config.h" + + +void change_fact(const Arg arg) { + fact += arg.f; + if (fact > 0.9f) + fact = 0.9f; + else if (fact < 0.1f) + fact = 0.1f; + win_organize(); +} + +void client_focus(const Arg arg) { + if (!list || !list->next) + return; + + if (cur == list) + cur = cur->next; + + cur->prev->next = cur->next; + if (cur->next) + cur->next->prev = cur->prev; + + cur->prev = 0; + list->prev = cur; + cur->next = list; + + list = cur; + + win_organize(); + + ws_save(ws); +} + +void win_focus(client *c) { + cur = c; + XSetInputFocus(d, cur->w, RevertToParent, CurrentTime); +} + +void notify_destroy(XEvent *e) { + win_del(e->xdestroywindow.window); + + if (list) win_focus(list); +} + +void notify_enter(XEvent *e) { + while(XCheckTypedEvent(d, EnterNotify, e)); + + for win if (c->w == e->xcrossing.window) win_focus(c); + win_organize(); +} + + +void map_request(XEvent *e) { + Window w = e->xmaprequest.window; + + XSelectInput(d, w, StructureNotifyMask|EnterWindowMask); + win_size(w, &wx, &wy, &ww, &wh); + win_add(w); + cur = list; + + if (wx + wy == 0) win_organize(); + + XMapWindow(d, w); + win_focus(list); +} + +void key_press(XEvent *e) { + KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0); + + for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) + if (keys[i].keysym == keysym && + mod_clean(keys[i].mod) == mod_clean(e->xkey.state)) + keys[i].function(keys[i].arg); +} + +void win_add(Window w) { + client *c; + + if (!(c = (client *) calloc(1, sizeof(client)))) + exit(1); + + c->w = w; + + /* client_focus(c) */ + if (list) { + c->prev = 0; + list->prev = c; + c->next = list; + } else { + c->prev = c->next = 0; + } + list = c; + + ws_save(ws); + + win_organize(); +} + +void win_del(Window w) { + client *x = 0; + + for win if (c->w == w) x = c; + + if (!list || !x) return; + if (list == x) list = x->next; + if (x->next) x->next->prev = x->prev; + if (x->prev) x->prev->next = x->next; + + free(x); + + win_organize(); + + ws_save(ws); +} + +void win_kill(const Arg arg) { + if (cur) { + XKillClient(d, cur->w); + } +} + +void win_organize(void) { + if(!list) + return; + + if (!list->next) { + XMoveResizeWindow(d, list->w, g, g, sw - g - g, sh - g - g); + return; + } + + int nx, ny; + nx = ny = g; + + int swg, shg; + swg = sw - g; + shg = sh - g; + + int p; + + int i = 0; + for (client* c = list;; c = c->next) { + if (i % 2) { + /* vert */ + p = (sh - ny) * fact; + if (c->next) + XMoveResizeWindow(d, c->w, nx, ny, swg - nx, p - g); + else { + XMoveResizeWindow(d, c->w, nx, ny, swg - nx, shg - ny); + return; + } + ny += p; + } else { + /* hori */ + p = (sw - nx) * fact; + if (c->next) + XMoveResizeWindow(d, c->w, nx, ny, p - g, shg - ny); + else { + XMoveResizeWindow(d, c->w, nx, ny, swg - nx, shg - ny); + return; + } + nx += p; + } + i++; + } +} + +void win_fs(const Arg arg) { + if (!cur) return; + + if ((cur->f = cur->f ? 0 : 1)) { + win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); + XMoveResizeWindow(d, cur->w, 0, 0, sw, sh); + + } else { + XMoveResizeWindow(d, cur->w, cur->wx, cur->wy, cur->ww, cur->wh); + } +} + +void win_to_ws(const Arg arg) { + int tmp = ws; + + if (arg.i == tmp) return; + + ws_sel(arg.i); + win_add(cur->w); + ws_save(arg.i); + + ws_sel(tmp); + win_del(cur->w); + XUnmapWindow(d, cur->w); + ws_save(tmp); + + if (list) win_focus(list); +} + +void win_prev(const Arg arg) { + if (!cur) return; + + if (cur->prev) { + XRaiseWindow(d, cur->prev->w); + win_focus(cur->prev); + } else { + client* c; + for (c = list; c->next; c = c->next); + XRaiseWindow(d, c->w); + win_focus(c); + } +} + +void win_next(const Arg arg) { + if (!cur) return; + + if (cur->next) { + XRaiseWindow(d, cur->next->w); + win_focus(cur->next); + } else { + XRaiseWindow(d, list->w); + win_focus(list); + } +} + +void ws_go(const Arg arg) { + int tmp = ws; + + if (arg.i == ws) return; + + ws_save(ws); + ws_sel(arg.i); + + for win XMapWindow(d, c->w); + + ws_sel(tmp); + + for win XUnmapWindow(d, c->w); + + ws_sel(arg.i); + + if (list) win_focus(list); else cur = 0; +} + +void run(const Arg arg) { + if (fork()) return; + if (d) close(ConnectionNumber(d)); + + setsid(); + execvp((char*)arg.com[0], (char**)arg.com); +} + +void input_grab(Window root) { + unsigned int i, j, modifiers[] = {0, LockMask, numlock, numlock|LockMask}; + XModifierKeymap *modmap = XGetModifierMapping(d); + KeyCode code; + + for (i = 0; i < 8; i++) + for (int k = 0; k < modmap->max_keypermod; k++) + if (modmap->modifiermap[i * modmap->max_keypermod + k] + == XKeysymToKeycode(d, 0xff7f)) + numlock = (1 << i); + + for (i = 0; i < sizeof(keys)/sizeof(*keys); i++) + if ((code = XKeysymToKeycode(d, keys[i].keysym))) + for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) + XGrabKey(d, code, keys[i].mod | modifiers[j], root, + True, GrabModeAsync, GrabModeAsync); + + for (i = 1; i < 4; i += 2) + for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) + XGrabButton(d, i, MOD | modifiers[j], root, True, + ButtonPressMask|ButtonReleaseMask|PointerMotionMask, + GrabModeAsync, GrabModeAsync, 0, 0); + + XFreeModifiermap(modmap); +} + +int main(void) { + XEvent ev; + + if (!(d = XOpenDisplay(0))) exit(1); + + signal(SIGCHLD, SIG_IGN); + XSetErrorHandler(xerror); + + int s = DefaultScreen(d); + root = RootWindow(d, s); + sw = XDisplayWidth(d, s); + sh = XDisplayHeight(d, s); + + XSelectInput(d, root, SubstructureRedirectMask); + XDefineCursor(d, root, XCreateFontCursor(d, 68)); + input_grab(root); + + while (1 && !XNextEvent(d, &ev)) // 1 && will forever be here. + if (events[ev.type]) events[ev.type](&ev); +} diff --git a/mfwm.h b/mfwm.h @@ -0,0 +1,59 @@ +#include <X11/Xlib.h> + +#define win (client* c=list;c;c=c->next) +#define ws_save(W) ws_list[W] = list +#define ws_sel(W) list = ws_list[ws = W] +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +#define win_size(W, gx, gy, gw, gh) \ + XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ + &(unsigned int){0}, &(unsigned int){0}) + +// Taken from DWM. Many thanks. https://git.suckless.org/dwm +#define mod_clean(mask) (mask & ~(numlock|LockMask) & \ + (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) + +typedef union { + const char** com; + const int i; + const Window w; + const float f; +} Arg; + +struct key { + unsigned int mod; + KeySym keysym; + void (*function)(const Arg arg); + const Arg arg; +}; + +typedef struct client { + struct client *next, *prev; + int f, wx, wy; + unsigned int ww, wh; + Window w; +} client; + +void client_focus(const Arg arg); +void configure_request(XEvent *e); +void change_fact(const Arg arg); +void input_grab(Window root); +void key_press(XEvent *e); +void map_request(XEvent *e); +void notify_destroy(XEvent *e); +void notify_enter(XEvent *e); +void notify_motion(XEvent *e); +void run(const Arg arg); +void win_add(Window w); +void win_center(const Arg arg); +void win_del(Window w); +void win_fs(const Arg arg); +void win_focus(client *c); +void win_kill(const Arg arg); +void win_organize(void); +void win_prev(const Arg arg); +void win_next(const Arg arg); +void win_to_ws(const Arg arg); +void ws_go(const Arg arg); + +static int xerror() { return 0; } diff --git a/sowm.c b/sowm.c @@ -1,348 +0,0 @@ -// sowm - An itsy bitsy floating window manager. - -#include <X11/Xlib.h> -#include <X11/XF86keysym.h> -#include <X11/keysym.h> -#include <X11/XKBlib.h> -#include <stdlib.h> -#include <signal.h> -#include <unistd.h> -#include <stdio.h> - -#include "sowm.h" - -static client *list = {0}, *ws_list[10] = {0}, *cur; -static int ws = 1, sw, sh, wx, wy, numlock = 0; -static unsigned int ww, wh; - -const int g = 10; -static float fact = 0.5f; - -static Display *d; -static XButtonEvent mouse; -static Window root; - -static void (*events[LASTEvent])(XEvent *e) = { - [ButtonPress] = button_press, - [ButtonRelease] = button_release, - [ConfigureRequest] = configure_request, - [KeyPress] = key_press, - [MapRequest] = map_request, - [DestroyNotify] = notify_destroy, - [EnterNotify] = notify_enter, - [MotionNotify] = notify_motion -}; - -#include "config.h" - -void win_focus(client *c) { - cur = c; - XSetInputFocus(d, cur->w, RevertToParent, CurrentTime); -} - -void notify_destroy(XEvent *e) { - win_del(e->xdestroywindow.window); - - if (list) win_focus(list->prev); -} - -void notify_enter(XEvent *e) { - while(XCheckTypedEvent(d, EnterNotify, e)); - - for win if (c->w == e->xcrossing.window) win_focus(c); -} - -void notify_motion(XEvent *e) { - if (!mouse.subwindow || cur->f) return; - - while(XCheckTypedEvent(d, MotionNotify, e)); - - int xd = e->xbutton.x_root - mouse.x_root; - int yd = e->xbutton.y_root - mouse.y_root; - - XMoveResizeWindow(d, mouse.subwindow, - wx + (mouse.button == 1 ? xd : 0), - wy + (mouse.button == 1 ? yd : 0), - MAX(1, ww + (mouse.button == 3 ? xd : 0)), - MAX(1, wh + (mouse.button == 3 ? yd : 0))); -} - -void key_press(XEvent *e) { - KeySym keysym = XkbKeycodeToKeysym(d, e->xkey.keycode, 0, 0); - - for (unsigned int i=0; i < sizeof(keys)/sizeof(*keys); ++i) - if (keys[i].keysym == keysym && - mod_clean(keys[i].mod) == mod_clean(e->xkey.state)) - keys[i].function(keys[i].arg); -} - -void button_press(XEvent *e) { - if (!e->xbutton.subwindow) return; - - win_size(e->xbutton.subwindow, &wx, &wy, &ww, &wh); - XRaiseWindow(d, e->xbutton.subwindow); - mouse = e->xbutton; -} - -void button_release(XEvent *e) { - mouse.subwindow = 0; -} - -void win_add(Window w) { - client *c; - - if (!(c = (client *) calloc(1, sizeof(client)))) - exit(1); - - c->w = w; - - /* client_focus(c) */ - if (list) { - list->prev->next = c; - c->prev = list->prev; - list->prev = c; - c->next = list; - } else { - list = c; - list->prev = list->next = list; - } - - ws_save(ws); - - organize(); -} - -void win_del(Window w) { - client *x = 0; - - for win if (c->w == w) x = c; - - if (!list || !x) return; - if (x->prev == x) list = 0; - if (list == x) list = x->next; - if (x->next) x->next->prev = x->prev; - if (x->prev) x->prev->next = x->next; - - free(x); - - organize(); - - ws_save(ws); -} - -void win_kill(const Arg arg) { - if (cur) { - XKillClient(d, cur->w); - } -} - -void win_center(const Arg arg) { - if (!cur) return; - - XMoveResizeWindow(d, cur->w, sw / 4, sh / 4, sw / 2, sh / 2); -} - -void win_fs(const Arg arg) { - if (!cur) return; - - if ((cur->f = cur->f ? 0 : 1)) { - win_size(cur->w, &cur->wx, &cur->wy, &cur->ww, &cur->wh); - XMoveResizeWindow(d, cur->w, 0, 0, sw, sh); - - } else { - XMoveResizeWindow(d, cur->w, cur->wx, cur->wy, cur->ww, cur->wh); - } -} - -void win_to_ws(const Arg arg) { - int tmp = ws; - - if (arg.i == tmp) return; - - ws_sel(arg.i); - win_add(cur->w); - ws_save(arg.i); - - ws_sel(tmp); - win_del(cur->w); - XUnmapWindow(d, cur->w); - ws_save(tmp); - - if (list) win_focus(list); -} - -void win_prev(const Arg arg) { - if (!cur) return; - - XRaiseWindow(d, cur->prev->w); - win_focus(cur->prev); -} - -void win_next(const Arg arg) { - if (!cur) return; - - XRaiseWindow(d, cur->next->w); - win_focus(cur->next); -} - -void ws_go(const Arg arg) { - int tmp = ws; - - if (arg.i == ws) return; - - ws_save(ws); - ws_sel(arg.i); - - for win XMapWindow(d, c->w); - - ws_sel(tmp); - - for win XUnmapWindow(d, c->w); - - ws_sel(arg.i); - - if (list) win_focus(list); else cur = 0; -} - -void configure_request(XEvent *e) { - XConfigureRequestEvent *ev = &e->xconfigurerequest; - - XConfigureWindow(d, ev->window, ev->value_mask, &(XWindowChanges) { - .x = ev->x, - .y = ev->y, - .width = ev->width, - .height = ev->height, - .sibling = ev->above, - .stack_mode = ev->detail - }); -} - -void map_request(XEvent *e) { - Window w = e->xmaprequest.window; - - XSelectInput(d, w, StructureNotifyMask|EnterWindowMask); - win_size(w, &wx, &wy, &ww, &wh); - win_add(w); - cur = list->prev; - - if (wx + wy == 0) organize(); - - XMapWindow(d, w); - win_focus(list->prev); -} - -void run(const Arg arg) { - if (fork()) return; - if (d) close(ConnectionNumber(d)); - - setsid(); - execvp((char*)arg.com[0], (char**)arg.com); -} - -void input_grab(Window root) { - unsigned int i, j, modifiers[] = {0, LockMask, numlock, numlock|LockMask}; - XModifierKeymap *modmap = XGetModifierMapping(d); - KeyCode code; - - for (i = 0; i < 8; i++) - for (int k = 0; k < modmap->max_keypermod; k++) - if (modmap->modifiermap[i * modmap->max_keypermod + k] - == XKeysymToKeycode(d, 0xff7f)) - numlock = (1 << i); - - for (i = 0; i < sizeof(keys)/sizeof(*keys); i++) - if ((code = XKeysymToKeycode(d, keys[i].keysym))) - for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) - XGrabKey(d, code, keys[i].mod | modifiers[j], root, - True, GrabModeAsync, GrabModeAsync); - - for (i = 1; i < 4; i += 2) - for (j = 0; j < sizeof(modifiers)/sizeof(*modifiers); j++) - XGrabButton(d, i, MOD | modifiers[j], root, True, - ButtonPressMask|ButtonReleaseMask|PointerMotionMask, - GrabModeAsync, GrabModeAsync, 0, 0); - - XFreeModifiermap(modmap); -} - -int main(void) { - XEvent ev; - - if (!(d = XOpenDisplay(0))) exit(1); - - signal(SIGCHLD, SIG_IGN); - XSetErrorHandler(xerror); - - int s = DefaultScreen(d); - root = RootWindow(d, s); - sw = XDisplayWidth(d, s); - sh = XDisplayHeight(d, s); - - XSelectInput(d, root, SubstructureRedirectMask); - XDefineCursor(d, root, XCreateFontCursor(d, 68)); - input_grab(root); - - while (1 && !XNextEvent(d, &ev)) // 1 && will forever be here. - if (events[ev.type]) events[ev.type](&ev); -} - -void change_fact(const Arg arg) { - fact += arg.f; - if (fact > 0.9f) - fact = 0.9f; - else if (fact < 0.1f) - fact = 0.1f; - organize(); -} - -void client_focus(const Arg arg) { - if (!list) - return; - - if (cur == list) - cur = cur->next; - - cur->prev->next = cur->next; - cur->next->prev = cur->prev; - - list->prev->next = cur; - cur->prev = list->prev; - list->prev = cur; - cur->next = list; - - list = cur; - - organize(); - - ws_save(ws); - -} - -void organize() { - if(!list) - return; - - int n = 0; - client* c = list; - client* cl = list->prev; - - for (; c && c != cl;c = c->next) n++; - - int nx; - nx = sw * fact; - - if (n == 0) { - XMoveResizeWindow(d, list->w, g, g, sw - (2*g), sh - (2*g)); - return; - } else { - XMoveResizeWindow(d, list->w, g, g, nx - (1.5*g), sh - (2*g)); - } - - int p = (sh - g) / n; - - c = list->next; - for (int i = 0; i < n; i++) { - XMoveResizeWindow(d, c->w, nx + (g / 2), g + i * p, sw - (nx + (1.5 * g)), p - g); - c = c->next; - } -} diff --git a/sowm.h b/sowm.h @@ -1,61 +0,0 @@ -#include <X11/Xlib.h> - -#define win (client *t=0, *c=list; c && t!=list->prev; t=c, c=c->next) -#define ws_save(W) ws_list[W] = list -#define ws_sel(W) list = ws_list[ws = W] -#define MAX(a, b) ((a) > (b) ? (a) : (b)) - -#define win_size(W, gx, gy, gw, gh) \ - XGetGeometry(d, W, &(Window){0}, gx, gy, gw, gh, \ - &(unsigned int){0}, &(unsigned int){0}) - -// Taken from DWM. Many thanks. https://git.suckless.org/dwm -#define mod_clean(mask) (mask & ~(numlock|LockMask) & \ - (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) - -typedef struct { - const char** com; - const int i; - const Window w; - const float f; -} Arg; - -struct key { - unsigned int mod; - KeySym keysym; - void (*function)(const Arg arg); - const Arg arg; -}; - -typedef struct client { - struct client *next, *prev; - int f, wx, wy; - unsigned int ww, wh; - Window w; -} client; - -void button_press(XEvent *e); -void button_release(XEvent *e); -void client_focus(const Arg arg); -void configure_request(XEvent *e); -void change_fact(const Arg arg); -void input_grab(Window root); -void key_press(XEvent *e); -void map_request(XEvent *e); -void notify_destroy(XEvent *e); -void notify_enter(XEvent *e); -void notify_motion(XEvent *e); -void organize(); -void run(const Arg arg); -void win_add(Window w); -void win_center(const Arg arg); -void win_del(Window w); -void win_fs(const Arg arg); -void win_focus(client *c); -void win_kill(const Arg arg); -void win_prev(const Arg arg); -void win_next(const Arg arg); -void win_to_ws(const Arg arg); -void ws_go(const Arg arg); - -static int xerror() { return 0; }