Make console text green
I wanted to make the console text green on my Slackware machine. I found the command "setterm -foreground green", but I can't find any way to make it come up any sooner that the log-in, and after I do something like dir, it switches back. Is there any way to make the console green from the start and stay that way?
|
PS1 prompt I think is what you are looking for.
Heres some stuff on arch linux but it should translate to slackware without any modifications: https://wiki.archlinux.org/index.php/Color_Bash_Prompt |
I don't know if that did anything or not since I already have it green partly so it might have been redundant, but it didn't fix either of my two problems. It's still white when loading and after I use dir.
|
I'm not sure I follow you..
Your PS1 prompt is specific to each user and is an environment variable associated with that shell. You would have to log out and log back in our source your .bashrc file for the changes to take effect. Can you give us some example of where the colors are not displaying properly? You say when you use dir? What does that mean. |
It's while when it's loading all the information and up until the log in. Then, once I log in, it's green. But after I do a command, such as dir, the the text color switches back to white.
|
dir colors are set by another variable, LS_COLORS. See the dircolors man page for more info on that.
The boot information will be in the default prompt and will not be what you set for your users .bashrc PS1 prompt. |
I don't want to change the dir colors, I want it to not change after dir.
And I know that what I set for the users will not apply to the boot. That's why I'm posting this question asking what does. |
The command dir uses its own variable to determine your colors. The LS_COLORS variable, it is not changing your PS1 prompt simply referencing a different variable.
I don't think you can modify the boot text color.. |
Yes, it is. I'll have a green prompt, I type "dir" and press enter, it shows the directory, and from there on I have a white prompt.
|
To get the kernel messages at boot in a different color you have to change a file in the kernel and recompile it. Search for the file vc.c in the kernel source tree. In that file, somewhere around the line 2865 you will find this line:
Code:
vc->vc_def_color = 0x07; /* white */ After the init-scripts take over, this will most likely revert this change, so you have to edit the init-scripts to get green output. I don't know how to change the behavior for the change after commands, like ls, that change the colors themselves. |
Quote:
Edit: Never mind. I figured out why my file search couldn't find it. It was set to only look in the home directory. |
seems The wrong architecture :-(
Code:
bash-4.2$ slocate "/vc.c" |
The following has worked for Debian in the past by adding the following to /etc/rc.local,
Code:
echo -en "\\033[32m\\033[8]" > /dev/tty1 |
Found it.
Quote:
|
Okay, I did a search of the folder where the Linux source files were and found no such vc.c.
|
All times are GMT -5. The time now is 11:05 AM. |