X11: raise an existing window via command line?
Given an X client window ID, is there a way to raise that window from the command line? $ xlsclients -a Window 0x3000001: Machine: ohm Name: Terminal Icon Name: foo Command: foo Instance/Class: foo/bar $ xraise -id 0x3000001 <-- this is what I would like to do You can also use wmctrl, which does similar things liori Like... http://zaurus.daemons.gr/menaie/build/hacks/xraise/xraise.c ? EDIT: Inserting the code in the answer : #include <X11/Xos.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> /* "borrowed" from xwininfo/dsimple.c */