/xctrl

Shared library to control an X11 window manager.

Primary LanguageCGNU General Public License v2.0GPL-2.0

This is a fork of https://github.com/tobias/xctrl, which adds a keyboard keypress 
event to the listen() function, which now not only allows this library to send 
keypresses to a specific window, but to listen for them as well.

A string_to_keysym() function was also added, which can be handy when combined 
with the existing send_keys() function. For example, when you have a keysym number 
but require a string representation of that key. I.e. from keysym 88 to char "W". 

Tested with Lua 5.3.6. The `-fPIC` build flag was added to the makefile for convenience.

----------------

This is a fork of https://github.com/yetanothergeek/xctrl modified to
allow multiple instances of xctrl within Lua.

I use this invocation to get it to build properly:

make install EXTRA_CFLAGS="-I/usr/include/lua5.1 -fPIC" EXTRA_LDFLAGS="-Wl,--no-as-needed"

----------------

Original README:

The X11 control library is a shared library that allows you to query and
manipulate various aspects of an X11 window manager and the windows it manages. 

It is based largely on Tomas Styblo's "wmctrl" command line tool, but has been
transformed into a C library with some additional features and a Lua binding.

It is intended to work with any EWMH / NetWM compatible window manager, but 
since support for these standards varies between different window managers and
clients, some functionality might be missing in some environments.

To build the Lua module, simply type "make" from the top-level directory,
and "make install" to install install it in Lua's package.cpath.

By default, the Makefile will use the first lua headers it can find. If your
Lua headers are installed somewhere else, you can do something like:

  % make EXTRA_CFLAGS=-I/usr/include/lua5.1
 
"make install" will use your "lua" executable to parse the package.cpath.
If your Lua executable has another name, specify the name as LUA= when
you install:

  % make install LUA=lua5.1

You can also specify a non-standard install path with DESTDIR=

  % make install DESTDIR=~/my-lua-modules

By default the Makefile builds a stripped library optimized for size,
but you can disable optimizations and retain debugging information by
using "make DEBUG=1"

It is also possible to build a separate shared library for use in
other applications by typing "make lib" but there is currently no
"make install" target for that type of build.


To link the C library statically into your own standalone application 
or library, define XCTRL_API as static and include the "xctrl.c" 
source file directly:

 #include <X11/Xlib.h>
 #define XCTRL_API static
 #include "xctrl.c"



The Lua binding should be fairly well documented, see the file:
 ./docs/lxctrl.html

There is currently no documentation for the C library, but reading the
sources and the Lua docs should give you some idea of what's there.