pushover | github | twitter | instagram | rss | contact


posted to writings on nov 13th, 2008 with tags c and openbsd

i wrote a perl script about a year ago called qconsole that used wmctrl to incrementally scroll an xterm down from the top of my screen, then back up when it was called again. i called it qconsole because i thought i remembered the game quake having a console like that. even though i have lots of xterms scattered around my screens all the time, having that one console around in whatever workspace i was in, accessible with a single keystroke, was really handy.

when i switched from fluxbox to xfce4/xfwm, it no longer worked because xfwm won't allow windows to be moved off-screen even a window's mapping geometry is specifically requesting it. that sucked, and i stopped using qconsole.

one day i found visor for mac os that provided something similar with terminal.app, which made me start looking again into making qconsole work on x11 with xfwm.

i used some of my pixelclock code and came up with a small c program that creates a window off-screen with no decorations, tells the window manager to ignore it, then spawns an xterm and passes its window id to the xterm's "-into" option to make the xterm draw itself inside the qconsole window. it binds a key (control+o), and scrolls the xterm up and down whenever it's pressed.

while searching this evening for stuff about visor, i came across some similar apps that are already for x11, but they require gnome or kde and so they suck.

because qconsole is just wrapping around xterm, most of the window settings like the font and colors can be controlled with x resources (like ".qconsole*background: blue") so there's no configuration file needed.

right now the control+o key binding is hard coded into the app and that probably won't be useful for some people, but i'm not sure how to support mapping a text argument like "control+o" to an actual keysym without a lot of work.

so download the code and send me a diff to support that. ok?

Comments? Contact me via Twitter or e-mail.