Xterm

From ArchWiki
Revision as of 11:54, 20 February 2009 by M3tr0g33k (talk | contribs) (New page: Category:Eye candy (English) Category:Desktop environments (English) == Introduction == Using openbox, it is as yet impossible to automatically apply transparency to a window as i...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Introduction

Using openbox, it is as yet impossible to automatically apply transparency to a window as it opens. This is a way of automatically applying tranparency to an opening xterm using transset-df. It uses a trick of running a script as you start the xterm which then runs another script which calls transset-df. The reason that it is so complicated, is that to run transet-df on the new xterm window as it opens, we need the XWINDOWID value for the window.

The three steps which happen to run transset-df on an opening xterm are:

  • Start xterm
  • Run a script which executes a command, then starts a bash shell
    • (This step is necessary because when you open an xterm with 'xterm -e' the command is executed and then the xterm closes. This is not what we want.)
  • Run a script which finds the XWINDOWID of the current xterm and passes it to transset-df to set the transparency

Making it work

Make a script in (for instance) /usr/local/bin called pre-exec. Make sure you have execute permission for everyone. The script is:

${*}
exec /bin/bash

Make a script in (for instance) /usr/local/bin called fader. Make sure you have execute permission for everyone. The script is:

transset-df -i `set | grep WINDOWID | awk 'BEGIN { FS = "=" } ; { print $2 }'` $1 >/dev/null 2>&1

When you want an xterm to open with a transparency level of 80%, call:

xterm -e pre-exec fader 0.8 &

I have put this line in my .config/openbox/menu.xml file so I always get a transparent xterm.

Explanation and links

To do...