LinuxQuestions.org
Have you heard the LinuxQuestions.org Podcast?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 04-10-2009, 03:58 PM   #1
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Debian Sid
Posts: 229
Thanked: 3
Question SOLVED: Setting terminal colors with setterm?


[Log in to get rid of this advertisement]
Hi all.
Problem: i would like to change terminal's font color to green instead of default grey.
I know that i need to run setterm right before showing the login prompt, so i tried to put 'setterm -foreground green -store' in /etc/rc.local - it changes the color but does it in current VC only and doesn't work in others (and i want all six VC's to have a green font). Theoretically it can be done with /etc/inittab (correct me if i'm wrong), but i can't remember how to put the setterm command in there. Googled all day long without result, so any help is appreciated.

PS:
Please notice that i don't mean colors of PS1, 'ls' etc. - it's already done - but color of login prompt right after boot, so don't waste your time telling me about .bashrc and escape sequences.

Last edited by z-vet; 04-11-2009 at 03:03 PM..
z-vet is offline  
Tag This Post , , ,
Reply With Quote
Old 04-11-2009, 09:26 AM   #2
colucix
Guru
 
Registered: Sep 2003
Location: Bologna, Italia
Distribution: OpenSUSE 11.1 CentOS 5.4 VectorLinux 6.0
Posts: 5,134
Thanked: 465
Try to put the following line in /etc/rc.local then reboot:
Code:
echo -en \\033[32m\\033[8] > /dev/console
colucix is offline     Reply With Quote
Old 04-11-2009, 02:42 PM   #3
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Debian Sid
Posts: 229
Thanked: 3

Original Poster
Well, i solved it:

Run setterm which clears the screen and changes the console font color (here - to «old-school» bold green as i like) before login prompt. 'man setterm' for all you can do with it.

Open /etc/inittab and find this block of code:

Code:
1:2345:respawn:/sbin/getty 38400 tty1
  2:23:respawn:/sbin/getty 38400 tty2
  3:23:respawn:/sbin/getty 38400 tty3
  4:23:respawn:/sbin/getty 38400 tty4
  5:23:respawn:/sbin/getty 38400 tty5
  6:23:respawn:/sbin/getty 38400 tty6

Add the following right after 'getty' on each line:

Code:
-I `setterm -clear all -foreground green -bold -store`

So it looks like this:

Code:
1:2345:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty1
2:23:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty2
3:23:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty3
4:23:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty4
5:23:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty5
6:23:respawn:/sbin/getty -I `setterm -clear all -foreground green -bold -store` 38400 tty6
Reboot, enjoy.
z-vet is offline     Reply With Quote
Old 05-01-2009, 10:19 AM   #4
bugsbunny4president
LQ Newbie
 
Registered: May 2009
Posts: 2
Thanked: 0
thanx 4 your great post - it solved my problem that gave my huge pain in my back because i was sittin at my machine 4 hours...

do you know how to change the colour of the startup screen (foreground) while booting the system?

thanx again

bugsbunny4president

Last edited by bugsbunny4president; 05-01-2009 at 10:30 AM..
bugsbunny4president is offline     Reply With Quote
Old 05-01-2009, 10:26 AM   #5
bugsbunny4president
LQ Newbie
 
Registered: May 2009
Posts: 2
Thanked: 0
sorry about my bad spelling... and "4 hours" for hours
bugsbunny4president is offline     Reply With Quote
Old 05-01-2009, 04:15 PM   #6
z-vet
Member
 
Registered: Aug 2004
Location: Israel
Distribution: Debian Sid
Posts: 229
Thanked: 3

Original Poster
Nope, i try to find it by myself. I'll post it here if i solve it too.
z-vet is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Terminal Colors Carlwill Debian 8 03-20-2008 04:53 PM
Terminal Colors Carlwill Debian 7 02-22-2008 05:41 AM
Setting - Directory / File colors for SSH terminal connections young_rhkid Linux - Newbie 1 02-23-2007 02:43 PM
colors in terminal cad Linux - General 1 01-03-2007 01:27 AM
Terminal Colors chakkerz Linux - General 2 11-22-2004 10:01 PM


All times are GMT -5. The time now is 07:45 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration