Skip to content
Samuel Hand edited this page Mar 8, 2016 · 10 revisions

Basic overview

After you have installed x11fs, just run it as so: x11fs <mountpoint>. This will mount the virtual filesystem at <mountpoint>, the file hierarchy of which looks something like this:

/0xXXXXXXXX - A directory representing a window. The directory name is the window ID.
    /0xXXXXXXXX/border - A directory containing files relating to the windows border.
        /0xXXXXXXXX/border/color - A write only file representing the windows border color.
        /0xXXXXXXXX/border/width - A read-write file representing the windows border width.
    /0xXXXXXXXX/geometry - A directory containing files relating to the windows geometry.
        /0xXXXXXXXX/geometry/height - A read-write file representing the height of a window.
        /0xXXXXXXXX/geometry/width - A read-write file representing the width of a window..
        /0xXXXXXXXX/geometry/x - A read-write file representing the x position of a window..
        /0xXXXXXXXX/geometry/y - A read-write file representing the y position of a window.
    /0xXXXXXXXX/class - A read only file representing the window class.
    /0xXXXXXXXX/ignored - A read-write file representing the window's ignored (overide_redirect) state.
    /0xXXXXXXXX/mapped - A read-write file representing the window's mapping state (if it is visible or not).
    /0xXXXXXXXX/stack - A write only file representing the window's stacking order.
    /0xXXXXXXXX/title - A read only file representing the window title.
/root - A directory representing the root window
    /root/geometry - A directory representing the root window 
        /root/geometry/width - A read only file representing the width of the root window (the screen width)
        /root/geometry/height - A read only file representing the height of the root window (the screen height)
/event - A read only file for getting events
/focused - A file containing the id of the currently focused window

All geometry files (x,y,width,height) just contain base 10 integers, and if they are writeable they expect numbers to be written to them in the same format. The border color file requires the color to be written in hexadecimal with an 0x prefix. Both the ignored and mapped files either contain the text "true" or "false", and this should be written to them. The stack file accepts the text values "raise", or "lower".

The focused file contains a window id in hexadecimal with the 0x prefix.

The event file works slightly differently it acts as a file stream (it has no end), and reading simply blocks until an event is produced. (I would have prefered to use inotify for listening to events but this would not have been practical) Events are outputted in the format EVENT: window id. EG: MAP: 0x004001fe. Currently the events that will be listened for are MAP (a window is shown), UNMAP (a window is hidden), CREATE (a window is created), DESTROY (a window is destroyed), ENTER (the cursor enters a window) and LEAVE (the cursor leaves a window). If you would like any other events to be supported please open an issue.

Clone this wiki locally