Main index > Off the wall > slick quake like console

By ZeroDivide (Desklet Author), on Tue May 3 16:18:15 2005: slick quake like console.

I just found a really slick quake type console called yeahconsole.

It's a xterm window that drops down from the top of the screen when you hit a shortcut key ( in my case Alt+grave ).

I've been looking for one of these for a while now but everything i've come across was made for gnome or kde and quite buggy.
Yeahconsole on the other hand is not tied to any window manager/DE and is itself only about 300 lines of code.

By syfou (Core Developer & Desklet Author), on Tue May 3 17:23:10 2005.

That's very nice, zerodivide. I didn't know about the -into function of xterm. The only thing I do not like is the automated quit that happen when we exit from the shell... Here is crude fix. Around line 243 of yeahconsole.c from version 0.3.1, change the execlp call to:

Code:


execlp("xterm", "xterm", "-name", "yeahconsole", "-b", "0", "-into", cmd, 
               "-e", "/path/to/script/script.sh", NULL);


Here, script.sh can be anything. Here is one to give some ideas for others:

Code:


#! /bin/sh
while(true); do 
    setterm -cursor off; read -s -n1; setterm -cursor on
    top
    /bin/bash
    clear
done


It toggles indefinitively between a completely empty state, a top process monitor and an interactive bash shell.

By ZeroDivide (Desklet Author), on Tue May 3 20:35:17 2005.

Cool idea syfou, heres the script im currently using.

Code:

#! /bin/sh
while(true); do
    setterm -cursor off; read -s -n1; setterm -cursor on
    top
    screen -d -R -S yeahconsole
    clear
done



The speed at which yeahconsole hides/shows itself is too slow for my liking so I added some options to speed it up.

yeahconsole*hideStep: 20
yeahconsole*showStep: 20

Heres a link to the modified yeahconsole.c file http://pastebin.ca/10869

By syfou (Core Developer & Desklet Author), on Tue May 3 21:32:03 2005.

Thanks. I wonder: what is this screen executable?

By ZeroDivide (Desklet Author), on Tue May 3 22:22:11 2005.

I would explain it, but i'm sure these links will do a way better job.

home page
http://www.gnu.org/software/screen/

tutorial
http://jmcpherson.org/screen.html

(from the tutorial) wrote:

Screen is best described as a terminal multiplexer. Using it, you can run any number of console-based applications--interactive command shells, curses-based applications, text editors, etc.--within a single terminal.

By syfou (Core Developer & Desklet Author), on Wed May 4 00:47:44 2005.

Screen is a nice program! Not that useful to me locally since my WM make a pretty good job at grouping multiple pseudo-terminal instances and swithing between them with specific keys bindings, except for one case: remote job on the sourceforge compile farm: I can now have multiple ncurses based program on a single connection... Thanks, zerodivide.

As for your speed tuning for the effect of yeahconsole, maybe should you submit it back to the author? I also found the defaults to be a bit slow after a while.

By exilejedi (Core Developer & Desklet Author), on Wed May 4 11:26:03 2005.

Screen is also immesurably useful if you have something to do that is going to take some significant amount of time to do and you don't want to hang around all day. It is typically the first thing I emerge on a new Gentoo box once the machine is minimally usable (on the network and sshd is going).

By syfou (Core Developer & Desklet Author), on Wed May 4 14:09:47 2005.

I see the utility there too.. I always relied on real multiple terminals under these circumstances. Under most linux, it is just a matter of pressing ALT+F[0-6], instead of C+A+* ...

By exilejedi (Core Developer & Desklet Author), on Wed May 4 15:46:05 2005.

A real terminal is fine if you want to remain at the machine for all that time... But let's say it's a Friday afternoon and I'm installing Gentoo on my old/slow machine, and I want it to be usable for real work by Monday morning without having to go back into the office... :-)

Also handy for long-running jobs on remote machines that you don't have physical access to... (Box is in a data center in another state, etc.)

Or for starting something at one location and resuming work on it at another (by detaching and reattaching to the screen), etc...

But speaking of yeahconsole, maybe I am an idiot (more likely than one might otherwise suspect), but I am having a dickens of a time getting it to compile on my x86 Gentoo box here.... I get this when I "make" after running its ./configure script:

Code:

gcc -DHAVE_CONFIG_H -I. -I. -I.     -I -c yeahconsole.c
/tmp/cca3oSzZ.o(.text+0x22): In function `main':
: undefined reference to `XOpenDisplay'
/tmp/cca3oSzZ.o(.text+0x3c): In function `main':
: undefined reference to `XDisplayName'
/tmp/cca3oSzZ.o(.text+0x98): In function `main':
: undefined reference to `XSetErrorHandler'
/tmp/cca3oSzZ.o(.text+0xad): In function `main':
: undefined reference to `XCreateFontCursor'
/tmp/cca3oSzZ.o(.text+0xd5): In function `main':
: undefined reference to `XNextEvent'
/tmp/cca3oSzZ.o(.text+0x10f): In function `main':
: undefined reference to `XSetInputFocus'
/tmp/cca3oSzZ.o(.text+0x146): In function `main':
: undefined reference to `XSetInputFocus'
/tmp/cca3oSzZ.o(.text+0x167): In function `main':
: undefined reference to `XKeycodeToKeysym'
/tmp/cca3oSzZ.o(.text+0x1ae): In function `main':
: undefined reference to `XSetInputFocus'
/tmp/cca3oSzZ.o(.text+0x1d6): In function `main':
: undefined reference to `XSync'
/tmp/cca3oSzZ.o(.text+0x1f1): In function `main':
: undefined reference to `XRaiseWindow'
/tmp/cca3oSzZ.o(.text+0x20e): In function `main':
: undefined reference to `XGetInputFocus'
/tmp/cca3oSzZ.o(.text+0x234): In function `main':
: undefined reference to `XSetInputFocus'
/tmp/cca3oSzZ.o(.text+0x2ca): In function `main':
: undefined reference to `XResizeWindow'
/tmp/cca3oSzZ.o(.text+0x2f8): In function `main':
: undefined reference to `XResizeWindow'
/tmp/cca3oSzZ.o(.text+0x344): In function `main':
: undefined reference to `XSetInputFocus'
/tmp/cca3oSzZ.o(.text+0x359): In function `main':
: undefined reference to `XSync'
/tmp/cca3oSzZ.o(.text+0x3aa): In function `roll':
: undefined reference to `XMoveWindow'
/tmp/cca3oSzZ.o(.text+0x3bf): In function `roll':
: undefined reference to `XSync'
/tmp/cca3oSzZ.o(.text+0x487): In function `get_defaults':
: undefined reference to `XGetModifierMapping'
/tmp/cca3oSzZ.o(.text+0x4d5): In function `get_defaults':
: undefined reference to `XKeysymToKeycode'
/tmp/cca3oSzZ.o(.text+0x500): In function `get_defaults':
: undefined reference to `XFreeModifiermap'
/tmp/cca3oSzZ.o(.text+0x51d): In function `get_defaults':
: undefined reference to `XGetDefault'
/tmp/cca3oSzZ.o(.text+0x580): In function `get_defaults':
: undefined reference to `XGetDefault'
/tmp/cca3oSzZ.o(.text+0x5bb): In function `get_defaults':
: undefined reference to `XGetDefault'
/tmp/cca3oSzZ.o(.text+0x600): In function `get_defaults':
: undefined reference to `XGetDefault'
/tmp/cca3oSzZ.o(.text+0x645): In function `get_defaults':
: undefined reference to `XGetDefault'
/tmp/cca3oSzZ.o(.text+0x68a): more undefined references to `XGetDefault' follow
/tmp/cca3oSzZ.o(.text+0x899): In function `grab_that_key':
: undefined reference to `XStringToKeysym'
/tmp/cca3oSzZ.o(.text+0x8b0): In function `grab_that_key':
: undefined reference to `XKeysymToKeycode'
/tmp/cca3oSzZ.o(.text+0x8ec): In function `grab_that_key':
: undefined reference to `XGrabKey'
/tmp/cca3oSzZ.o(.text+0x900): In function `grab_that_key':
: undefined reference to `XKeysymToKeycode'
/tmp/cca3oSzZ.o(.text+0x93f): In function `grab_that_key':
: undefined reference to `XGrabKey'
/tmp/cca3oSzZ.o(.text+0x95d): In function `grab_that_key':
: undefined reference to `XKeysymToKeycode'
/tmp/cca3oSzZ.o(.text+0x99c): In function `grab_that_key':
: undefined reference to `XGrabKey'
/tmp/cca3oSzZ.o(.text+0x9b0): In function `grab_that_key':
: undefined reference to `XKeysymToKeycode'
/tmp/cca3oSzZ.o(.text+0x9f2): In function `grab_that_key':
: undefined reference to `XGrabKey'
/tmp/cca3oSzZ.o(.text+0xa97): In function `init_win':
: undefined reference to `XCreateWindow'
/tmp/cca3oSzZ.o(.text+0xaba): In function `init_win':
: undefined reference to `XSelectInput'
/tmp/cca3oSzZ.o(.text+0xb04): In function `init_win':
: undefined reference to `XAllocNamedColor'
/tmp/cca3oSzZ.o(.text+0xb21): In function `init_win':
: undefined reference to `XSetWindowBackground'
/tmp/cca3oSzZ.o(.text+0xb37): In function `init_win':
: undefined reference to `XMapWindow'
/tmp/cca3oSzZ.o(.text+0xbf3): In function `init_xterm':
: undefined reference to `XMaskEvent'
/tmp/cca3oSzZ.o(.text+0xc2d): In function `init_xterm':
: undefined reference to `XSetWindowBorderWidth'
/tmp/cca3oSzZ.o(.text+0xc32): In function `init_xterm':
: undefined reference to `XAllocSizeHints'
/tmp/cca3oSzZ.o(.text+0xc62): In function `init_xterm':
: undefined reference to `XGetWMNormalHints'
/tmp/cca3oSzZ.o(.text+0xc8f): In function `init_xterm':
: undefined reference to `XFree'
/tmp/cca3oSzZ.o(.text+0xcb7): In function `init_xterm':
: undefined reference to `XResizeWindow'
/tmp/cca3oSzZ.o(.text+0xcff): In function `init_xterm':
: undefined reference to `XMoveResizeWindow'
/tmp/cca3oSzZ.o(.text+0xd59): In function `resize':
: undefined reference to `XGrabPointer'
/tmp/cca3oSzZ.o(.text+0xd7f): In function `resize':
: undefined reference to `XMaskEvent'
/tmp/cca3oSzZ.o(.text+0xde0): In function `resize':
: undefined reference to `XResizeWindow'
/tmp/cca3oSzZ.o(.text+0xe0e): In function `resize':
: undefined reference to `XResizeWindow'
/tmp/cca3oSzZ.o(.text+0xe23): In function `resize':
: undefined reference to `XSync'
/tmp/cca3oSzZ.o(.text+0xe3d): In function `resize':
: undefined reference to `XUngrabPointer'
collect2: ld returned 1 exit status
make: *** [yeahconsole.o] Error 1



I suspect that it's not finding some X headers or libs or something important... Any suggestions? (Running what is now Gentoo 2005.0 w/ Xorg.)

By syfou (Core Developer & Desklet Author), on Wed May 4 15:54:19 2005.

Oh - for remote jobs, I completely agree. :-)

As for your compilation trouble, just compile it by hand... configure is broken.

Code:


gcc -lX11 yeahconsole.c -o yeahconsole



adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.