General
cancel
Showing results for 
Search instead for 
Did you mean: 

konsole: How to set background color?

Thomas Schler_1
Trusted Contributor

konsole: How to set background color?

Hi,

I like to choose background/foreground colors starting the konsole from the shell. 'konsole --help-qt' tells how to do (quite similar to e.g. xterm -bg red -fg green). But 'konsole --bg red --fg green' does not work. I use the color names listed in /usr/lib/X11/rgb.txt. This color list works as 'xcolors' shows them all.

How do I set background/foreground colors starting konsole from the shell?
no users -- no problems
9 REPLIES
G. Vrijhoeven
Honored Contributor

Re: konsole: How to set background color?

Olivier Drouin
Trusted Contributor

Re: konsole: How to set background color?

there is a set of predefined schemas in

Settings -> schema -> your_choice

personnaly its "green on black" and I use ls colors for more readable listings. Along with a cool $PS1.
Mark Grant
Honored Contributor

Re: konsole: How to set background color?

Create your own schemas within konsole and either select them manually from within konsole or startup konsole as "konsole --schema "

You could even have a little script called "mykonsole" which looks a bit like this to get a random schema each time you start konsole

IND=$RANDOM
IND=`echo $RANDOM | cut -c${#IND}`

schema[0]=red
schema[1]=blue
schema[2]=red
schema[3]=green
schama[4]=green
schame[5]=blue
schema[6]=yellow
schama[7]=cyan
schema[8]=red
schema[9]=blue

konsole --schema ${schema[$IND]}"$@"

I think I should have done this in perl :)
Never preceed any demonstration with anything more predictive than "watch this"
Claudio Cilloni
Honored Contributor

Re: konsole: How to set background color?

there's an editor for the color schemas.
right click -> Settings -> Configure Konsole

in the 'Colors' box choose the Shell Color n.1 and the Konsole Color you prefer.

hth!
Ciao
Claudio
G. Vrijhoeven
Honored Contributor

Re: konsole: How to set background color?

Thomas Schler_1
Trusted Contributor

Re: konsole: How to set background color?

Mark:

The option '--schema' is not documented and produces the error message "unknown option". I am using SuSE Linux 8.1, KDE 3.0.5, Konsole 1.1.3. Other idea?

Claudio, G. Vrijhoeven:

Thanks. But as I mentioned I like to set colors by calling konsole from the shell.
no users -- no problems
Mark Grant
Honored Contributor

Re: konsole: How to set background color?

Well, I did a hack to konsole to select schemas from the command line back in the days of KDE 2.X and I remember shortly afterwards being surprised to find the feature supported. Try running "konsole --help" from the command line to make sure you don't have it.

Before doing my hack, I had a little script as a wrapper around konsole that just copied random schemas to the default one that I was using and then started the real konsole. This is only practical if you create a few schemas and save them. That way you are copying stuff in "$HOME/.kde/share/apps/konsole" rather than the system wide one.
Never preceed any demonstration with anything more predictive than "watch this"
Claudio Cilloni
Honored Contributor

Re: konsole: How to set background color?

I think you should create and save your color schema using the editor as I said before, then run:

$ konsole --schema

you don't need the full path of the .schema file, just the name of the schema; this works for me (RH9, kde 3.1-10).

Martin P.J. Zinser
Honored Contributor

Re: konsole: How to set background color?

Hello,

this is on SuSE 8.2 with

konsole --version
Qt: 3.1.1
KDE: 3.1.1
Konsole: 1.2.1

To create a new schema, use Setiings->Configure Konsole . Build the schema to your liking, save it with a new name (e.g. i used MPJZ which produced file MPJZ.schema), then invoke a new konsole as konsole --schema e.g in my case konsole --schema MPJZ and that gave me a red foreground (since this is what I changed in the settings editor).

HTH, Martin