I have been trying to make a Lisp my go-to language for small projects. Racket is a fantastic language and used by many people who are a lot smarter than I am. I have been meaning to learn the Racket FFI and a perfect exercise is to implement TinyWM in it. From the TinyWM webpage:
- Move windows interactively with Alt+Button1 drag (left mouse button)
- Resize windows interactively with Alt+Button3 drag (right mouse button)
- Raise windows with Alt+F1 (not high on usability I know, but I needed a keybinding in there somewhere)
- Focus windows with the mouse pointer (X does this on its own)
My OS is Ubuntu 12.04 and I assume that this code will run on Linux. You can check if you have the X11 headers and so on by using this snippet:
Once we've confirmed that everything works, you can run tinywm.rkt . Overall the file is at 100-ish lines but I mostly multiline function calls that in the original source fit into 1 line.