LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-12-2011, 09:41 PM   #1
yanom
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 51

Rep: Reputation: 2
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!

Last edited by yanom; 05-29-2011 at 10:19 AM. Reason: new feature
 
Old 05-13-2011, 02:04 PM   #2
xzcallaway
Member
 
Registered: Oct 2008
Posts: 33

Rep: Reputation: 4
That is very pretty.
 
Old 05-23-2011, 05:03 PM   #3
yanom
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 51

Original Poster
Rep: Reputation: 2
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.

Last edited by yanom; 05-26-2011 at 09:29 AM.
 
Old 05-23-2011, 10:28 PM   #4
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
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.
Ed
 
Old 05-29-2011, 10:11 AM   #5
yanom
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 51

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


Reply

Tags
color, fun, random, wrapper, xterm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find out what program last time wrote on given file nima0102 Linux - Software 3 09-19-2010 08:30 AM
Wrote java program and can't connect to sql database mokoena Programming 1 07-12-2008 10:01 AM
What is the last program you wrote (or are currently writing)? lowpro2k3 Programming 2 08-15-2005 01:14 AM
I met an error when I wrote a gtk program icoming Programming 1 03-16-2005 03:19 PM
Wrote a program: TEXTDRAW lea Programming 1 08-13-2002 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration