How can I specify a display?

The way that X works is the same as the way any network program works. You have a server of some description (in this case, the X display server) which runs on a specific machine, and you have X clients (like firefox) that try to connect to that server to get their information displayed. Often … Read more

X11: move an existing window via command line?

I think xdotool will do the job. xdotool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11’s XTEST extension and other Xlib functions. E.g. $ xdotool windowfocus 0x1a00ad2 will focus the window with id 0x1a00ad2. There’s also a windowmove command which is probably … Read more

Global Hotkey with X11/Xlib

Your program works here. My guess is you have another modifier active, such as NumLock. GrabKey only works on the exact modifier mask. For example here is some (GPL) code from metacity window manager /* Grab/ungrab, ignoring all annoying modifiers like NumLock etc. */ static void meta_change_keygrab (MetaDisplay *display, Window xwindow, gboolean grab, int keysym, … Read more

How to get an X11 Window from a Process ID?

The only way I know to do this is to traverse the tree of windows until you find what you’re looking for. Traversing isn’t hard (just see what xwininfo -root -tree does by looking at xwininfo.c if you need an example). But how do you identify the window you are looking for? Some applications set … Read more