diff --git a/README.md b/README.md index 7cb6e4b..1a832a7 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,8 @@ For the true minimalist: - Includes just what is strictly needed. - Not standards compliant (because, honestly, who gives a fuck?). - All windows are full-screen, just one is visible at any given time. -- -`mwm` just loops through X key press events and lets you bind -actions to key presses. It provides two macros: `grab` and `K`. -Read the source for an example on how to use it (my own setup). +Two macros are available for assigning keybindings: `grab` and `K`. +Read the source for an example on how to use them (my own setup). Dead simple. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..744c7a0 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#! /bin/sh + + +rm -f mwm; tcc -lX11 mwm.c -o mwm diff --git a/mwm.c b/mwm.c index a61b16f..1644f31 100644 --- a/mwm.c +++ b/mwm.c @@ -12,26 +12,25 @@ int main () { Display *d = XOpenDisplay(0); Window r = DefaultRootWindow(d); XEvent e; XSelectInput (d, r, SubstructureRedirectMask); - grab ("q", "n", "l", "space", "Return", "Right", "Left", "Up", "Down"); + grab ("n", "q", "w", "t", "l", "u", "i", "o", "p"); while (!XNextEvent (d, &e)) { E (KeyPress, K("n", XCirculateSubwindowsUp(d, r); XSetInputFocus(d, e.xkey.window, 2, 0)) K("q", XKillClient(d, e.xkey.subwindow)) - K("l", system("rotK &")) - K("space", system("chromium &")) - K("Return", system("xterm &")) - K("Right", system("vol 5%+ &")) - K("Left", system("vol 5%- &")) - K("Up", system("bri +100 &")) - K("Down", system("bri -100 &"))) + K("w", system("chromium --enable-features=WebContentsForceDark &")) + K("t", system("xterm &")) + K("l", system("rotK")) + K("u", system("vol 5%-")) + K("i", system("vol 5%+")) + K("o", system("bri -100")) + K("p", system("bri +100"))) - E (MapRequest, - XMapWindow(d, e.xmaprequest.window); - XSetInputFocus(d, e.xmaprequest.window, 2, 0)) + E (MapRequest, XMapWindow(d, e.xmaprequest.window); + XSetInputFocus(d, e.xmaprequest.window, 2, 0)) E (ConfigureRequest, - XMoveResizeWindow (d, e.xconfigure.window, 0, 0, e.xconfigure.width, e.xconfigure.height); - XMoveResizeWindow (d, e.xconfigure.window, 0, 0, 1920, 1080)) + XMoveResizeWindow (d, e.xconfigure.window, 0, 0, e.xconfigure.width, e.xconfigure.height); + XMoveResizeWindow (d, e.xconfigure.window, 0, 0, 1920, 1080)) } }