Difference between revisions of "Xterm"

From ArchWiki
Jump to: navigation, search
(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...)
 
m
(36 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Category:Eye candy (English)]]
+
[[Category:Terminal emulators]]
[[Category:Desktop environments (English)]]
+
[[de:Xterm]]
 +
[[ru:Xterm]]
 +
'''xterm''' is the standard [[Wikipedia:Terminal emulator|terminal emulator]] for the [[X Window System]].
  
== Introduction ==
+
==Automatic transparency==
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:
+
[[pacman|Install]] the package {{pkg|transset-df}} and a [[Wikipedia:Compositing window manager|composite manager]] like [[Xcompmgr]].
  
* Start xterm
+
Add the following line to your {{ic|~/.bashrc}}:
* 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 ==
+
[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null
Make a script in (for instance) /usr/local/bin called '''pre-exec'''. Make sure you have execute permission for everyone. The script is:
+
  
${*}
+
Now, each time you launch a shell in an xterm and a composite manager is running, it will become transparent.
exec /bin/bash
+
the test in front of the transset-df command keeps it from executing if that variable is not defined. Note that your terminal will not be transparent if you launch a program other than the shell this way. It is probably possible to work around this if you want the functionality.
  
Make a script in (for instance) /usr/local/bin called '''fader'''. Make sure you have execute permission for everyone. The script is:
+
===See Also===
 +
*[[Per Application Transparency]]
  
transset-df -i `set | grep WINDOWID | awk 'BEGIN { FS = "=" } ; { print $2 }'` $1 >/dev/null 2>&1
+
==Tips==
 +
===Xterm menu===
 +
Xterm has a hidden menu that can be viewed by holding the {{Keypress|Ctrl}} key and pressing the first mouse button (left click) on a Xterm window.
  
When you want an xterm to open with a transparency level of 80%, call:
+
===Enable bell urgency===
 +
Add the following line to your {{ic|~/.Xresources}} file:
  
  xterm -e pre-exec fader 0.8 &
+
  xterm*bellIsUrgent: true
  
I have put this line in my .config/openbox/menu.xml file so I always get a transparent xterm.
+
===Remove black border===
 +
Xterm has a black border in some cases, you can disable this by adding the following line to your {{ic|~/.Xresources}} file.
  
== Explanation and links ==
+
xterm*borderWidth: 0
To do...
+
 
 +
===My Alt key doesn't work correctly===
 +
You can fix this on a per-term basis by enabling the Meta Sends Escape option in the Xterm menu, or for all Xterm terminals by adding the following line to your {{ic|~/.Xresources}} file.
 +
 
 +
xterm*metaSendsEscape: true
 +
 
 +
===Change background and font color===
 +
First you make an Xresource file which is a regular textfile and it is described at [[X resources]]. You find a color you like at http://www.colorpicker.com/ and copy the 6 alphanumerical above the picture. Then to change your background you add
 +
{{bc|
 +
xterm*background: #<alphanumeric>
 +
}}
 +
and for the font you add
 +
{{bc|
 +
xterm*foreground: #<alphanumeric>
 +
}}
 +
Notice the casing on xterm. It did not work for me with XTerm or Xterm. Also after you make changes and do  
 +
{{bc|
 +
xrdb -merge /path/to/Xresources
 +
}}
 +
or
 +
{{bc|
 +
xrdb /path/to/Xresources
 +
}}
 +
you have to start a new xterm window to see the changes.
 +
 
 +
===Hide the scrollbar===
 +
In order to hide xterm's scrollbar, add the following to your .Xresources/.Xdefaults file.
 +
 
 +
xterm*scrollBar: off

Revision as of 16:59, 4 November 2012

xterm is the standard terminal emulator for the X Window System.

Automatic transparency

Install the package transset-df and a composite manager like Xcompmgr.

Add the following line to your ~/.bashrc:

[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null

Now, each time you launch a shell in an xterm and a composite manager is running, it will become transparent. the test in front of the transset-df command keeps it from executing if that variable is not defined. Note that your terminal will not be transparent if you launch a program other than the shell this way. It is probably possible to work around this if you want the functionality.

See Also

Tips

Xterm menu

Xterm has a hidden menu that can be viewed by holding the Template:Keypress key and pressing the first mouse button (left click) on a Xterm window.

Enable bell urgency

Add the following line to your ~/.Xresources file:

xterm*bellIsUrgent: true

Remove black border

Xterm has a black border in some cases, you can disable this by adding the following line to your ~/.Xresources file.

xterm*borderWidth: 0

My Alt key doesn't work correctly

You can fix this on a per-term basis by enabling the Meta Sends Escape option in the Xterm menu, or for all Xterm terminals by adding the following line to your ~/.Xresources file.

xterm*metaSendsEscape: true

Change background and font color

First you make an Xresource file which is a regular textfile and it is described at X resources. You find a color you like at http://www.colorpicker.com/ and copy the 6 alphanumerical above the picture. Then to change your background you add

xterm*background: #<alphanumeric>

and for the font you add

xterm*foreground: #<alphanumeric>

Notice the casing on xterm. It did not work for me with XTerm or Xterm. Also after you make changes and do

xrdb -merge /path/to/Xresources

or

xrdb /path/to/Xresources

you have to start a new xterm window to see the changes.

Hide the scrollbar

In order to hide xterm's scrollbar, add the following to your .Xresources/.Xdefaults file.

xterm*scrollBar: off