Solved xterm configuration file?

I've looked around for something like a .xterm.rc, but don't see anything which can be use to apply various settings to xterm. Where should I look?
xterm() mentions configuration numerous times but there is no mention of a specific congfiguration file. What am I missing?

I'm mainly trying autostart a program when starting xterm. I am aware of the '-e' but don't want to type all parameters every time I run xterm.

Code:
 -e program [ arguments ... ]
           This  option  specifies    the  program  (and  its     command  line
           arguments)  to  be  run    in the xterm window.  It also sets the
           window title and    icon name to be    the basename  of  the  program
           being  executed    if  neither -T nor -n are given    on the command
           line.
 
I'm not sure what you want to do, why don't you use a .sh script?
I used them to run ssh or KVM and put a title to each window, among other things.
 
You can create a .Xresources file and then put xrdb .Xresources in your .xinitc

Example content:
Code:
XTerm.VT100.faceName: xos4 Terminess Powerline
XTerm.VT100.faceSize: 8 

XTerm.VT100.faceSize1: 8
XTerm.VT100.faceSize2: 10
XTerm.VT100.faceSize3: 12
XTerm.VT100.faceSize4: 14
XTerm.VT100.faceSize5: 16
XTerm.VT100.faceSize6: 18
XTerm.fontMenu.font1.Label: 8
XTerm.fontMenu.font2.Label: 10
XTerm.fontMenu.font3.Label: 12
XTerm.fontMenu.font4.Label: 14
XTerm.fontMenu.font5.Label: 16
XTerm.fontMenu.font6.Label: 18

XTerm*termName: xterm-256color
XTerm*foreground: #d0d0d0
XTerm*background: black
XTerm*visualBell: true
XTerm*scrollBar: on
XTerm*rightScrollBar: true
XTerm*scrollTtyOutput: false
XTerm*saveLines: 2000
XTerm*locale: true
 
No. Backwards:
Bash:
~/bin/my-script.sh
#!/usr/local/bin/bash
#Style Y
xrdb ~/.XresourcesY
xterm -e my-command1 my-args

~/bin/my-script2.sh
#!/usr/local/bin/bash
#Style Z
xrdb ~/.XresourcesZ
xterm -e my-command2 my-args

xrdb()
Look for load (default), override, merge.
 
No. Backwards:
Bash:
~/bin/my-script
#!/usr/local/bin/bash
#Style 1
xterm -e my-command1 my-args
xrdb ~/.XresourcesY

~/bin/my-script2
#!/usr/local/bin/bash
#Style 2
xterm -e my-command2 my-args
xrdb ~/.XresourcesZ

xrdb()
Look for load (default), override, merge.
As a result of this, should I expect xterm to run 'my-command1' and 'my-command2' on startup?
 
I'm mainly trying autostart a program when starting xterm.
No, you use .xinitrc to run after startx, not at xterm startup.
You don't open xterm, you run the scripts separately for each style you want.

If you want something automated, you can create a script that asks for a style variable, then load the style-file with xrdb and run xterm. Just link this script as your xterm launcher.
Something like xmessage or xdialog I don't remember the commands.
 
You can create a .Xresources file and then put xrdb .Xresources in your .xinitc

Example content:
Code:
XTerm.VT100.faceName: xos4 Terminess Powerline
XTerm.VT100.faceSize: 8

XTerm.VT100.faceSize1: 8
XTerm.VT100.faceSize2: 10
XTerm.VT100.faceSize3: 12
XTerm.VT100.faceSize4: 14
XTerm.VT100.faceSize5: 16
XTerm.VT100.faceSize6: 18
XTerm.fontMenu.font1.Label: 8
XTerm.fontMenu.font2.Label: 10
XTerm.fontMenu.font3.Label: 12
XTerm.fontMenu.font4.Label: 14
XTerm.fontMenu.font5.Label: 16
XTerm.fontMenu.font6.Label: 18

XTerm*termName: xterm-256color
XTerm*foreground: #d0d0d0
XTerm*background: black
XTerm*visualBell: true
XTerm*scrollBar: on
XTerm*rightScrollBar: true
XTerm*scrollTtyOutput: false
XTerm*saveLines: 2000
XTerm*locale: true
This or just a single ~/.Xdefaults could lead to large monolithic configuration file. Thus I would propose a refinement by breaking it down into separate files per each X application. As such, an ~/.Xdefaults would contain just common/global settings and a directory ~/.Xdefaults.d would contain a file for each application such as XTerm, XCalc, XClock, XCalendar, XkbLEDPanel, X3270xad and so on... For this to work it suffices, for instance, to set an environment variable in ~/.xinitrc like export XAPPLRESDIR="$HOME/.Xdefaults.d/" and create each file as appropriate.
 
This or just a single ~/.Xdefaults could lead to large monolithic configuration file. Thus I would propose a refinement by breaking it down into separate files per each X application. As such, an ~/.Xdefaults would contain just common/global settings and a directory ~/.Xdefaults.d would contain a file for each application such as XTerm, XCalc, XClock, XCalendar, XkbLEDPanel, X3270xad and so on... For this to work it suffices, for instance, to set an environment variable in ~/.xinitrc like export XAPPLRESDIR="$HOME/.Xdefaults.d/" and create each file as appropriate.

See Thread 91402/post-637858

... a very very informative post.
 
Back
Top