Bashrun - Frequently Asked Questions


1. How can I remove the window decorations for bashrun in my wm?
2. Can I use the Escape key to hide or exit bashrun?
3. Why doesn't resizing work in my preferred terminal?
4. Meta keybindings (e.g. Alt-w) don't work, what can I do?
5. Can I create my own custom actions and bind them to key sequences?


1. How can I remove the window decorations for bashrun in my wm?

The X properties for the terminal window are set as follows:

You should be able to use these properties to configure your wm to omit window decorations for windows matching these properties. Examples:

Openbox:

Add the following lines to the <applications> section in your rc.xml:

  <application name="bashrun">
    <decor>no</decor>
    <focus>yes</focus>
    <skip_pager>yes</skip_pager>
    <layer>above</layer>
    <desktop>all</desktop>
  </application>
    

Pekwm:

Add the following entry to your ~/.pekwm/autoproperties file:


      Property = "^bashrun,^XTerm" {
        ApplyOn = "Start New"
        Border = "False"; Titlebar = "False"
        Sticky = "True"
      }
      

Compiz:

Use "!(title=bashrun)" in CCSM

Generic:

If your wm doesn't support per application settings out of the box, you can use Devil's Pie to disable decorations by creating

~/.devilspie/bashrun.ds
containing
  ( if 
  ( and 
  ( matches ( window_name ) "bashrun" )
  ) 
  ( begin 
  ( undecorate )
  ( skip_pager )
  ( skip_tasklist )
  ( wintype "utility" )
  )
  )
      

thanks to Dieter@be, dmz and Jérôme M. for these suggestions.


2. Can I use the Escape key to hide or exit bashrun?

The escape key is a meta key in readline and can't be bound on it's own, so you can't do it with a bashrun keybinding. You'll have to use a method similar to this:

  1. Before running bashrun, dynamically bind the escape key to execute bashrun --hide or bashrun --exit, using your WM or X11
  2. Run bashrun
  3. Wait for the bashrun window to be unmapped or destroyed
  4. Remove the escape keybinding again

Here's a script that uses xbindkeys and xdotool to implement this method:

#!/bin/bash

# frontend to bashrun, hides bashrun using the escape key
# uses xdotool (http://www.semicomplete.com/projects/xdotool/)
#      xbindkeys (http://hocwp.free.fr/xbindkeys/xbindkeys.html)

XBINDKEYSRC=~/.xbindkeysrc
TMPFILE=~/.xbindkeysrc.tmp

# note that xbindkeys needs at least one keybinding defined in
# .xbindkeysrc to run

function update {
    
    if ! killall -HUP xbindkeys; then
	echo "error: can't HUP xbindkeys, please make sure it's running."
	remove_escape
	exit 1
    fi

    # man xbindkeys says: "When HUP signal is send to xbindkeys,
    # changes in $HOME/.xbindkeysrc takes effect only after moving
    # mouse." ... 
    
    LOC=`xdotool getmouselocation 2> /dev/null`
    X=$(echo $LOC | cut -d ' ' -f 1 | cut -d ':' -f 2)
    Y=$(echo $LOC | cut -d ' ' -f 2 | cut -d ':' -f 2)
    xdotool mousemove 0 0 2> /dev/null
    xdotool mousemove $X $Y 2> /dev/null
}

function add_escape {
    echo -e "\"bashrun --hide\"\nEscape" >> $XBINDKEYSRC
    update
}

function remove_escape {
    cp $XBINDKEYSRC $TMPFILE && head -n -2 $TMPFILE > $XBINDKEYSRC && rm $TMPFILE
    update
}

add_escape

bashrun --show &
bashrun --wait

remove_escape
      

Use this script as a frontend for launching bashrun.


3. Why doesn't resizing work in my preferred terminal?

Only xterm and *rxvt support the ansi escape sequence ^[[8;<lines>;<cols>t used by bashrun for resizing the terminal.

XTerm requires the allowWindowOps resource to be set to True to allow window resizing.


4. Meta keybindings (e.g. Alt-w) don't work, what can I do?

Configure your terminal to translate Alt-w into <Escape>-w. This is usually called "MetaSendsEscape" or similar. For Xterm, use

	XTerm*metaSendsEscape: True
	XTerm*altSendsEscape: True
      
in your ~/.Xdefaults file. You may need to reload your X settings with xrdb -merge ~/.Xdefaults before restarting bashrun. Other terminals should provide similar settings/options.


5. Can I create my own custom actions and bind them to key sequences?

This feature is currently being worked on.


(c) 2008 Henning Bekel <h dot bekel at googlemail dot com>