Skip to main content
Welcome guest. | Register | Login | Post

How to change CLI backgroud/font?

3 replies [Last post]
Offline
Joined: 2007-11-14

OpenSuse has a very nice CLI, with a background and a bold font. Kubuntu, on the other hand, does not. How can I configure my Kubuntu installation so that I have a diffrent font and backgroud? (and by the CLI, I do not mean the terminal. I mean the command line interface that is outside of X)

Thanks in advance.

Offline
Joined: 2007-09-10
I think you have to edit

I think you have to edit your ~/.bashrc file. You have to change the PS1 strings.
I don't have the time to find a good link about it now, but here's my .bashrc for example:

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color)
    #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    PS1="\e[0;1;33;41m[\u@\h:\w]\$ \e[m "
    ;;
*)
    #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    PS1="\e[0;1;33;41m[\u@\h:\w]\$ \e[m "
    ;;
esac

    # set a fancy prompt
    #PS1="\e[0;31m[\u@\h \W]\$ \e[m "
    #PS1="\e[0;1;33;41m[\u@\h:\w]\$ \e[m "
    #PS1='\u@\h:\w\$ '

# Comment in the above and uncomment this below for a color prompt
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

#if [ -f ~/.bash_aliases ]; then
#    . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='ls --color=auto --format=vertical'
    #alias vdir='ls --color=auto --format=long'
fi

# some more ls aliases
alias laf='ls -laF'
alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'
alias rm='rm -iv'
alias mv='mv -iv'
alias cp='cp -iv' 

#alias sudo='sudo -s'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
    PATH=~/bin:"${PATH}"
fi

#set current directory as session name! :D
#export PS1=$PS1"\[\e]30;\H:\W\a\]"

The last line is my favourite for use with Konsole.
However it leads to weird things in the ctrl+alt+F1 console.
I also have some strange word-wrapping problems in normal terminaks when typing long commands or pressing the home key. Sad

As for background images, I have no idea. You're sure they don't use a fullscreen terminal?

free-zombie's picture
Offline
Joined: 2006-03-08
For posh graphics in the

For posh graphics in the terminal, you need to enable a framebuffer console. This can usually be done by adding a vga=... option to your kernel (in /boot/grub/menu.lst). vga=794 gives you a 1280x1024 console, for instance. This may be enabled in *buntu by default (usplash, their splash screen system, probably needs it) Background images can be set by bootsprash or gensplash, and probably in some other way. Installing bootsplash or gensplash (splash screen systems) might not be a brilliant idea in Kubuntu as it uses usplash already (which you might be able to disable)

I'm not sure about the details, but that was what I know on the subject and it should get you started. Remember google ;-)

Offline
Joined: 2007-09-10
Sounds interesting. Will

Sounds interesting. Will have to try that.