*edit: As this sometimes needs to be updated, I have uploaded it here. If the version in this post doesn't work, try the one on my site. It is symlinked to the script that I use on my system so it should always be the latest working version. *

caveatsYou'll have to change the "/path/to/*" lines to point to the scripts on your system and the "<y>" tag in the "<position>" tag and the geometry line in the urxvtq script to resize and reposition the console window.

faqWhy are you using xdotool to get the window ID?urxvt won't show up with "wmctrl -l", even though conky and ipager do... after ripping out most of my URxvt* settings in .Xdefaults, I gave up trying to figure out why. If you find a better solution, please post it. Until then, I'm sticking to what works.

What's with the "xdotool key Control_L+l" line?When the console first opens it messes up my PS1 var, which contains color codes, a newline char and some unicode characters. I'm not sure what the cause is though because opening urxvt normally doesn't do that. Maybe it's due to the resizing event. Anyway, that line just sends a "ctrl+l" signal to the window to clear it when it first opens (not every time it toggles).

Um, urxvt has a perl script called kuake that does this already, lol.Wtf, that's not even a question, but ok. The kauke script doesn't accept modifiers so you effectively sacrifice the entire physical key that you bind kuake to, which isn't optimal. With the openbox bindings, you have more options.

Why didn't you just do <better solution>?Either because I didn't think of it, couldn't figure it out or because it's not actually a better solution (for me).

Feel free to share any improvements. If enough people find this useful, I'll wiki it. Consider this a trial run.

*edit* I've modified urxvtq to incorporate some elements from hbekel's general script below

Re: HOWTO: get a quake-like urxvt terminal in openbox

This looks good! I use scratchpad from xmonad-contrib which does something similiar in xmonad. I never realised how useful a quick access terminal is until I started using it. Using urxvtd is a nice touch.

Re: HOWTO: get a quake-like urxvt terminal in openbox

Re: HOWTO: get a quake-like urxvt terminal in openbox

Xyne wrote:

Um, urxvt has a perl script called kuake that does this already

People often overlook the fact that urxvt has an extension for this. However it's still better to be able to create a "quake console" with just about any terminal emulator on your WM. Especially if tilda, yakuake and the rest are lesser terminals than the one you use.

Re: HOWTO: get a quake-like urxvt terminal in openbox

This looks familiar, I do something very similar to keep bashrun running in the background. I've generalized your toggling script a little and came up with

~/bin/toggle:

Usage: toggle -n <wm_name> -c <command> [-i <initial>]
wm_name : The WM_NAME of the window to toggle
command : The command creating the window to be toggled
initial : initial command to run after the window has been created

So, in order to run a "quake-like" xterm all you have to do it bind a key to

toggle -n qterm -c 'xterm -name qterm'

If there is no xterm of that name running, it will be started, subsequent invocations toggle window visibility. Toggling is done by mapping/unmapping the window using xdotool only (no need to mix xdotool and wmctrl). The --onlyvisible option to xdotools's search command is used to determine wether the window is currently visible or not.

Note that the command used to launch the program needs to set up the WM_NAME for the window accordingly.

To send an initial command, use the -i option, e.g.

toggle -n qterm -c 'xterm -name qterm' -i 'xdotool key ctrl+l'

This is only the toggling part, of course. Window placement and appearance can be configured as shown by Xyne.

Re: HOWTO: get a quake-like urxvt terminal in openbox

I've just put together another version of a quake-like terminal that features animation and works for xterm, urxvt and mrxvt.

Since these terminals set $WINDOWID, it's easier to map/unmap the window from within the terminal's bash session. This way the an outside script doesn't have to rely on finding the right window via a certain WM_NAME. Instead you can send a SIGUSR1 to terminal from the outside to toggle it, using the pid from a pidfile. See the script itself for further instructions, including a method to assure that only one terminal at a time is the quake-like terminal.

Plus it's animated and scrolls down/up like yakuake and others.

Note that this script isn't run as a program, but sourced into the bash session from the terminal you want to use.

The above toggle script is still usable to toggle any kind of program, not just terminals.

The screenshot shows urxvt at 113x20, on a 1024x768 screen, with a one pixel border supplied by openbox, which just happens to fit real nice.

Note that the animation feature in the last script works only by resizing line-wise, so it's probably not as smooth as in a more sophisticated terminal like yakuake, and may not work very well on slow machines.

Re: HOWTO: get a quake-like urxvt terminal in openbox

The two scripts work, my W-grave key pops up a urxvt instance, however subsequent W-grave presses just create more instances instead of hiding the existing one. Also, the urxvtq instance doesn't seem to pay any attention to .Xdefaults, while the urxvtc one does (W-t). Any ideas?

The first line will apply to a urxvt with the -name urxvt (default).The second line will apply to a urxvt started via urxvt -name urxvtq (as it's done in Xyne's script)The third line will apply to any urxvt, regardless of which -name was given to launch it.

Re: HOWTO: get a quake-like urxvt terminal in openbox

Xyne wrote:

When the console first opens it messes up my PS1 var, which contains color codes, a newline char and some unicode characters. I'm not sure what the cause is though because opening urxvt normally doesn't do that. Maybe it's due to the resizing event. Anyway, that line just sends a "ctrl+l" signal to the window to clear it when it first opens (not every time it toggles).

though you already have a solution, this may be of interest. it's an old thread, so i'm not sure if the patch would apply to the latest version but anyway...