Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Ruby || Python) window manager

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

like image 931
deuces Avatar asked Sep 06 '09 21:09

deuces


3 Answers

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/

like image 53
jedediah Avatar answered Nov 13 '22 07:11

jedediah


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.

like image 2
James Black Avatar answered Nov 13 '22 07:11

James Black


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.

like image 2
nevarmaor Avatar answered Nov 13 '22 07:11

nevarmaor