OK, no testing has been done here, just going off on a tangent presuming this will work.
OK, I assume you use Gnome Terminal. Gnome Terminal colours are no longer customisable via a startup switch (and haven't been for some time).
You can, however, write a wrapper script that:
- Has a predefined list of colours to mix
- Chooses a random one
- Sets the random colours via gconftool-2, and starts the real gnome-terminal.
Code:
#!/bin/sh
# Predefined colour sets.
BG_COLOURS=(
FFFFFFFFDDDD # Cream Yellow
FFFFFFFFFFFF # White
000000000000 # Black
000000000000 # Black
000000000000 # Black
)
FG_COLOURS=(
000000000000 # Black
000000000000 # Black
AAAAAAAAAAAA # Grey
0000FFFF0000 # Green
FFFFFFFFFFFF # White
)
# Number of elems in the array.
NUM=${#FG_COLOURS[@]}
# Pick a random number
ELEM=$(($RANDOM % $NUM))
# Set colours
gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/background_color "#${BG_COLOURS[$ELEM]}"
gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/foreground_color "#${FG_COLOURS[$ELEM]}"
# Start gnome-terminal
exec /usr/bin/gnome-terminal.distrib "$@"
And to install:
Code:
sudo dpkg-divert --local --rename --add /usr/bin/gnome-terminal
sudo install script-name.sh /usr/bin/gnome-terminal
And to uninstall:
Code:
sudo unlink /usr/bin/gnome-terminal
sudo dpkg-divert --local --rename --remove /usr/bin/gnome-terminal
Some playing will be needed, yes. But hopefully a step in the right direction.
Bookmarks