Manipulate terminal session background color

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Manipulate terminal session background color
# 1  
Old 09-29-2011
Manipulate terminal session background color

Greetings,

I know I can manipulate from AppleScript to terminal.app or just run commands from apple script.

But what about from a BASH Script.

when A user logs in and runs a maintenance utility I have written for them, I want to modify their background color and text color.

example;

Code:
#!/bin/bash
clear
bold=`tput smso`
offbold=`tput rmso`
	echo -e "\033[33;33m fo034 \033[33;40m User Mail Is \033[31;5m ${bold} NOT ACTIVE ${offbold} \033[31;0m"
	echo -e "\033[33;33m fo035            \033[31;5m  Error in Account  \033[31;0m"
	echo -e " now thats some kung f00 "


I want to Change the background color of his terminal session. Lets say " white Text on Black Screen, not just ||||||||| blacked out lines.
How can I manipulate the terminal screen color ?
# 2  
Old 09-29-2011
Change background color then clear the screen(using the 'clear' utility, or 'tput clear'), that should set the entire window.

---------- Post updated at 08:47 AM ---------- Previous update was at 08:43 AM ----------

Code:
\033[33;33m

This seems redundant -- you're setting the same foreground color twice. 3x is foreground color, 4x is background color. 1 makes the foreground extra bright.

Try
Code:
printf "\033[1;33;43m" ; clear

bright yellow on dark yellow.

Code:
printf "\033[0;30;47m" ; clear

white background on black text. I don't think you can make the background brighter.

printf is more portable than echo -e -- echo -e is mostly a linux thing.
# 3  
Old 09-29-2011
Thanks,

Im guessing there is not way to change the whole screen in one shot. the Code above works line by line, changing the background color of the lines Im working on.

No problem, using this code will work just fine, thanks.
# 4  
Old 09-29-2011
Quote:
Originally Posted by doctorfoo1
Im guessing there is not way to change the whole screen in one shot.
That's what the 'clear' is for.

If it doesn't work, your prompt may be changing the color back on you.
# 5  
Old 01-14-2012
Quote:
Originally Posted by doctorfoo1
Greetings,

I know I can manipulate from AppleScript to terminal.app or just run commands from apple script.

But what about from a BASH Script.

when A user logs in and runs a maintenance utility I have written for them, I want to modify their background color and text color.

example;

Code:
#!/bin/bash
clear
bold=`tput smso`
offbold=`tput rmso`
	echo -e "\033[33;33m fo034 \033[33;40m User Mail Is \033[31;5m ${bold} NOT ACTIVE ${offbold} \033[31;0m"
	echo -e "\033[33;33m fo035            \033[31;5m  Error in Account  \033[31;0m"
	echo -e " now thats some kung f00 "


I want to Change the background color of his terminal session. Lets say " white Text on Black Screen, not just ||||||||| blacked out lines.
How can I manipulate the terminal screen color ?
pls Smilie Change the background color
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

2. Programming

how to change the default background color for x windows

I am using uil to build the widgets. I compiled the below code using gcc 3.4.6 compiler. Launched x window in light gray color. How to change the default color of the window? #include <X11/Xlib.h> #include <Xm/Xm.h> #include <Mrm/MrmAppl.h> void main ( int argc, char **argv ) {... (1 Reply)
Discussion started by: satish@123
1 Replies

3. Red Hat

New Background and Text Color

Hi. How do I change the background color and text in Fedora. I did find the set_color -b command. Thanks (1 Reply)
Discussion started by: Ccccc
1 Replies

4. Shell Programming and Scripting

Python- Changing background color on Button click

Hi, I am trying to write a python program which changes background color on click of button. However i am stuck up. Instead of changing the color currently it is creating a new frame every time. please look at the code and let me know how to correct it #!/usr/bin/env python from Tkinter... (0 Replies)
Discussion started by: vickylife
0 Replies

5. AIX

Enabling color for putty session

Hi Everyone: Is there any way to enable colors through putty for a session into AIX? I've tried to set the TERM variable to xterm-256color but it doesn't work having a 8-color terminal would be okay for me thanks in advance (5 Replies)
Discussion started by: edgarvm
5 Replies

6. Shell Programming and Scripting

how to set background color in Unix terminal

Hi All, how do I set in .profile file Unix terminal background color = BLUE ? Please advice me. :confused: (2 Replies)
Discussion started by: raghur77
2 Replies

7. Shell Programming and Scripting

Shell script to manipulate a message count for the same IP @ diff session

I have a file as like below, 10:20:30.45 START 10.20.30.40 10:20:31.46 HELLO 10.20.30.40 10:20:32.46 START 10.20.30.41 10:20:33.44 END 10.20.30.40 10:20:35.44 HELLO 10.20.30.41 10:20:36.56 HELLO 10.20.30.41 10:20:37.78 HELLO 10.20.30.41 10:20:38.99 START 10.20.30.40... (1 Reply)
Discussion started by: gobinath
1 Replies

8. UNIX for Dummies Questions & Answers

Change background color in VI editor

Hi, I am new to unix. How can i change the background color in vi? Thank you. -tictactoe (1 Reply)
Discussion started by: tictactoe
1 Replies

9. UNIX for Dummies Questions & Answers

Checking background jobs from another session

Ok, so I'm comfortable backgrounding jobs in the shell, starting and stopping them, and bringing them to the fg and bg. What I can't figure out is how to monitor those background jobs from another shell (remote, or local). Example: - On a local console for MYHOST, I su to root - I then update... (3 Replies)
Discussion started by: vikingshelmut
3 Replies

10. UNIX for Dummies Questions & Answers

set background/foreground color in .profile

I am using a telnet session (VT100) and need to modify my .profile so that it will set the color of the telnet session. I am not using Xterm (ie: can't use .Xdefaults). I am able to change the colors via menu's but need to preset in .profile. Is this possible??? Can't find anything at all on how... (3 Replies)
Discussion started by: dvella
3 Replies
Login or Register to Ask a Question