A simple way to create a color message is to use Xdialog
This is explained at the website supporting Xdialog
http://xdialog.free.fr/doc/common.html#RCFILE
The example they give is
Code: Select all
Xdialog --rc-file bluebox.rc --msgbox "--rc-file demonstration." 0 0
bluebox.rc file contents:
Code: Select all
style 'blue_background' {
bg[NORMAL] = { 0.0, 0.3, 0.8 }
fg[NORMAL] = { 1.0, 1.0, 1.0 }
}
widget '*' style 'blue_background'
The result is blue background and white text.
________________________________________________
Here is a more detailed example based on what I used in baconrecorder...
I gave the path to find the rc file as /root/.config/pclock/yellowbox.rc
So this file must exist!!! Hide it somewhere in /root.
Code: Select all
Xdialog --title "$(gettext 'Recording')" --rc-file /root/.config/pclock/yellowbox.rc --wrap --left --center --ok-label "$(gettext 'Close')" --msgbox "\n$(gettext 'You are ready to make a new recording.')\n$(gettext 'Enter new settings.')\n" 0 0 100 &
Here is the contents of the rc-file
Code: Select all
style 'yellow_background' {
bg[NORMAL] = { 0.99, 0.99, 0.50 }
fg[NORMAL] = { 0, 0, 0 }
}
widget '*' style 'yellow_background'
The result is yellow background and black text.
For more examples look at the script for baconrecorder or ptmtimer
baconrecorder download
ptmtimer download