LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Looking for a Terminal Emulator that's fun to use? Try out this program I wrote! (http://www.linuxquestions.org/questions/linux-software-2/looking-for-a-terminal-emulator-thats-fun-to-use-try-out-this-program-i-wrote-880432/)

yanom 05-12-2011 09:41 PM

Looking for a Terminal Emulator that's fun to use? Try out this program I wrote!
 
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!

xzcallaway 05-13-2011 02:04 PM

That is very pretty.

yanom 05-23-2011 05:03 PM

Oh, by the way, this does not appear to work on Macs. Despite these being UNIX-based and having xterm installed, rcxterm wouldn't start on my friend's mac.

EdGr 05-23-2011 10:28 PM

Sometime around 1990, my employer bought Unix workstations that, for the first time, had color displays. The previous workstations we used had monochrome displays.

To celebrate, I wrote a shell script to open a bunch of xterms all in different colors, and did all my work that way for several years. My screen looked like a tie-dye shirt.

My co-workers thought it was nutty.

Fun times. :D
Ed

yanom 05-29-2011 10:11 AM

New feature added: pass arguments to rcxterm that you could pass to xterm. See the Original Post for more.


All times are GMT -5. The time now is 01:38 AM.