6

I want to make a window manager in either of these languages (Preferably ruby). I honestly have no idea where to start except that I will need some kind of X module to load. So if anyone has a clue it would be great if you could point me in the right direction. Thanks

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
deuces
  • 733
  • 1
  • 10
  • 17

4 Answers4

7

XCB, the next gen API for X uses an XML format to define X protocols and generates specific language bindings with a script. It's similar in concept to SWIG except that instead of describing C APIs, it describes X protocols.

Currently, bindings exist for C and Python. A Ruby port would theoretically be only a matter of writing a translator from the XML protocol definition language to Ruby. The generated Ruby code could either wrap the C API or implement the wire protocol in pure Ruby (I recommend the latter).

The API apparently has some inherent advantages over the legacy Xlib related to blocking I/O. It also has a Windows port, oddly enough.

http://xcb.freedesktop.org/

http://xcb.freedesktop.org//XcbPythonBinding/

http://xcb.freedesktop.org//win32port/

jedediah
  • 1,179
  • 9
  • 20
2

Have you looked at http://ruby-xlib-wrap.sourceforge.net/. This appears to provide Ruby bindings for XLib.

You may want to experiment with using XWindows before trying to write a window manager.

Why not start with a desktop, so you can get some experience.

James Black
  • 41,583
  • 10
  • 86
  • 166
2

Note:

1) Awesome is not written in lua, it's written in C. It uses Lua as a scripting/config interface.

2) Qtile and Samurai-X are two wm's are written in python.

3) Subtle is a wm that uses ruby as a scripting language.

Qtile and Subtle are both tiling window managers.

SpaceGhost
  • 359
  • 5
  • 17
nevarmaor
  • 21
  • 1
0

Not Ruby or Python, but these window managers are also written in cool languages: awesome (Lua) and XMonad (Haskell). Maybe you can peek inside their internals and see how they work.

Steven Kryskalla
  • 14,179
  • 2
  • 40
  • 42