Here is a short Python program I wrote. It's a wrapper over XTerm.
It's called RCXTerm, short for Random Colored X Terminal. It arose out of my inability to choose a text color for my terminal. I then wrote this to randomly choose a color for me each time I open it.
To run it, copy the source code below into a file, name it rcxterm, and make it executable ($
chmod +x rcxterm works for this), and run it. You can edit the third and fourth lines of text to change the available colors and the font size. Once you're done, you can copy it into the /usr/bin directory and all system users can open it with the
rcxterm command (but not edit it).
You can pass (most) arguments to rcxterm like you might pass them to xterm, so long as those arguments are enclosed in quotes.
For example, running
rcxterm "-geom 20x20" would be the same as running
xterm -geom 20x20 . For some reason, certain arguments like
-title are a bit buggy on RCXTerm.
Code:
#!/usr/bin/python
import sys
available_colors = ["magenta","yellow", "white", "green", "cyan", "orange", "purple"]
fontsize = 19
import random
import os
if (len(sys.argv) > 1):
argstring = sys.argv[1]
else:
argstring = "" #nothing.
color = random.choice(available_colors)
font = "-*-courier 10 pitch-*-r-*-*-" + str(fontsize) + "-*-*-*-*-*-*-*"
command = 'xterm -font \"' + font + '\" -bg black' + ' -fg ' + color + ' ' + argstring
os.system(command)
Enjoy!