PDA

View Full Version : Green [ ok ] messages



rasher
December 19th, 2004, 12:24 AM
I was annoyed that during boot, only the status messages showing [fail] got coloured (red), so I created a very simple patch that makes the [ ok ] messages appear in green.

The patch applies to /lib/lsb/init-functions


--- init-functions.orig 2004-12-18 23:45:08.756780424 +0100
+++ init-functions 2004-12-18 23:44:52.699221544 +0100
@@ -190,9 +190,10 @@
END=`$TPUT hpa $COL`
START=`$TPUT hpa 0`
RED=`$TPUT setaf 1`
+ GREEN=`$TPUT setaf 2`
NORMAL=`$TPUT op`
if [ $1 -eq 0 ]; then
- echo "$UP$END[ ok ]"
+ echo "$UP$END[ ${GREEN}ok${NORMAL} ]"
else
echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]"
fi
I'm not at all sure this belongs in "Ubuntu Screenshots / Art Talk", but I figured it was about making Ubuntu pretty, and I didn't know where else to put it.

oddabe19
December 19th, 2004, 05:41 AM
I was annoyed that during boot, only the status messages showing [fail] got coloured (red), so I created a very simple patch that makes the [ ok ] messages appear in green.

The patch applies to /lib/lsb/init-functions


--- init-functions.orig 2004-12-18 23:45:08.756780424 +0100
+++ init-functions 2004-12-18 23:44:52.699221544 +0100
@@ -190,9 +190,10 @@
END=`$TPUT hpa $COL`
START=`$TPUT hpa 0`
RED=`$TPUT setaf 1`
+ GREEN=`$TPUT setaf 2`
NORMAL=`$TPUT op`
if [ $1 -eq 0 ]; then
- echo "$UP$END[ ok ]"
+ echo "$UP$END[ ${GREEN}ok${NORMAL} ]"
else
echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]"
fi
I'm not at all sure this belongs in "Ubuntu Screenshots / Art Talk", but I figured it was about making Ubuntu pretty, and I didn't know where else to put it.


I know what you're talking about, and how to apply it, but howabout explaining how to apply the patch for those that don't know.

Smash
December 25th, 2004, 10:55 AM
I think he would like to say to remove lines that starts with -, and add lines that starts with +.

Iive not already tried.

Good tip.
TNX

Rotarychainsaw
December 25th, 2004, 08:37 PM
oops, i didnt take out the minuses but it still works.

fng
January 9th, 2005, 02:34 AM
This patch should be default in ubuntu.

maart
January 10th, 2005, 12:12 AM
What are other possible colors to use?

zeroK
January 10th, 2005, 12:28 AM
This patch should be default in ubuntu.
Yeah, I was thinking exactly the same thing right after booting Ubuntu for the first time. Thanks rusher :-)

shimon
January 10th, 2005, 09:57 AM
This patch should be default in ubuntu.
yes another distros have it

but uslpash will hide this patch

heema
January 10th, 2005, 10:48 AM
Yeah thanks , as i have been used to seeing the OK green

it gives me a good feeling that everything is working right :smile:

Device
January 10th, 2005, 07:34 PM
I know what you're talking about, and how to apply it, but howabout explaining how to apply the patch for those that don't know.
patch -p0 < /path/to/this/patch

shimon
January 11th, 2005, 11:22 AM
<HostingGeek> Green [ ok ] messages? why not apply this patch by default like all other distros have?
<HostingGeek> http://ubuntuforums.org/showthread.php?t=8556
<fabbione> it has been discussed on the mailing list iirc
<fabbione> because it is a communityu decision done by all users
<fabbione> therefor discussed between all of them
<fabbione> and the verdic was something like: no thanks
<fabbione> for different reasons
<mjt> "quiet" graphical boot, green/red messages.. and a cup of coffee every morning pls. ugh.
<HostingGeek> link
<HostingGeek> i need to join more mailing lists
<Keybuk> fundamantally, colour should only be used to highlight problems
<Keybuk> in particular, that's a very silly patch -- the green and red are of the same intensity, so a colour blind person wouldn't see any difference
<Keybuk> by using red for fail, they stand out in the otherwise black/white boot sequence
<Treenaks> make it BLINK
<Treenaks> that's stand out for sure!
* Keybuk shakes his head
<Keybuk> it'll be colour prompts next
<Treenaks> Keybuk: Ubuntu needs more gentoo influence :P
--> Gorth (~Gorth@cpe.atm2-0-51110.0x50a4d38e.abnxx10.customer.tele.dk) has joined #ubuntu-devel
<Keybuk> we had gentoo influence for warty
* Mithrandir whacks Treenaks
<bob2> next you'll all be madly trying to get the boot time down to < 30 seconds

doobiest
April 11th, 2007, 07:20 PM
has anyone found out how to do this for newer versions? Feisty? I cant figure it out, the init-functions file is much different.

oktubr3
September 16th, 2008, 10:53 PM
For Ubuntu Hardy Heron: http://www.drfest.com.ar/2008/09/howto-arranque-de-ubuntu-804-sin.html

cdsboy
September 18th, 2008, 10:29 PM
<bob2> next you'll all be madly trying to get the boot time down to < 30 seconds

A little off topic but... my boot time is 26 seconds xD

dantata
July 21st, 2009, 12:39 AM
How does this (green OK) work in Jaunty? For instance, there is no echo "$UP$END[ ok ]" line?

Thanks.

Labello
July 21st, 2009, 10:20 AM
A little off topic but... my boot time is 26 seconds xD

not that fast, but depends on your machine ;-)


How does this (green OK) work in Jaunty? For instance, there is no echo "$UP$END[ ok ]" line?

Thanks.

I was also wondering how to achieve that with jaunty... ame problem here ;)

mcduck
July 23rd, 2009, 05:28 PM
Edit /etc/lsb-base-logging.sh, then change the echo "[ OK ]" in line 136 (under the log_to_console log_end_msg -line) to this:


printf '[ '
$TPUT setaf 2 # green
printf OK
$TPUT op # normal
echo ' ]'

razorboy5
July 23rd, 2009, 11:46 PM
sry very noob at Ubuntu

could u explain how to apply this patch again?

i opened up the file specified ( see alot of words and codes )

do i just copy the code on there?

thx

dantata
July 24th, 2009, 10:01 AM
Edit /etc/lsb-base-logging.sh, then change the echo "[ OK ]" in line 136 (under the log_to_console log_end_msg -line) to this:


printf '[ '
$TPUT setaf 2 # green
printf OK
$TPUT op # normal
echo ' ]'

Thanks. Worked like a charm.

Labello
July 24th, 2009, 12:58 PM
Thanks. Worked like a charm.

+1

confirmed

razorboy5
July 26th, 2009, 05:37 PM
ok +2 for confirmed :P thx

however the OK button doesn't show during boot but shows on shutdown

is that normal? i'm on 9.0.4 jaunty Ubuntu

Gourgi
July 26th, 2009, 06:21 PM
Edit /etc/lsb-base-logging.sh, then change the echo "[ OK ]" in line 136 (under the log_to_console log_end_msg -line) to this:


printf '[ '
$TPUT setaf 2 # green
printf OK
$TPUT op # normal
echo ' ]'

thanks!
nice tip