LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-31-2014, 04:52 AM   #1
errigour
Member
 
Registered: May 2009
Posts: 366

Rep: Reputation: 6
Kernel Source: Where is text mode color?


Alright i just want to ask if anyone knows where the kernel handles it's color in the source. Like is it possible to add more color options for the linux executable files manually? Also I want to change the orange color \x1B[0;33m to something more yellow and I don't know where to look.

Last edited by errigour; 05-31-2014 at 04:54 AM.
 
Old 05-31-2014, 06:21 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Colorize happens in specific user space programs. The variable LS_COLORS maps file names to colors for the ls command, for example. To modify it, do:

echo LS_COLORS=\"$LS_COLORS\" > ~/.lscolors
echo "source .lscolors" >> ~/.bashrc

Then edit the file .lscolors to add what you want. The format of the string is not well [URL="http://linux-sxs.org/housekeeping/lscolors.html"]documented[/URL, though.
 
Old 05-31-2014, 08:06 AM   #3
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
I was looking for more of a permanent change that would affect the color of the tty2 session in the kernel source code.
 
Old 05-31-2014, 09:10 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
You will not find that, kernel does not contain such information. (Also there is no "color options for the linux executable") You need to specify your problem much better: what have you done (clicked or which command did you type and execute)? Probably you can post us a screenshot to show which color do you mean.
 
Old 05-31-2014, 10:45 AM   #5
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
What do you mean the kernel source code doesn't handle the color? What does then if vmlinux doesn't handle the color? It's the normal yellow color that looks like it's brown.
 
Old 05-31-2014, 12:17 PM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
that is not handled by the kernel itself, but other user space programs. There is no "normal yellow color" in general, but usually it is a default for an application. Which one did you mention? What looks brown now?
 
Old 05-31-2014, 07:33 PM   #7
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
Oh ok I get it now thanks. Does anyone know which user space program handles the color? Is it a library file that handles the color? What exactly is an example of a user space program?
 
Old 06-01-2014, 03:48 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
color of what? please specify what are you talking about.
All the programs you know about are user space programs, but the kernel itself. So the command ls, grep or a browser, a terminal emulator, text editor or a game all are user space programs and all of them are able to manage its own colors. That's why would be important to explain which one are you talking about.
 
Old 06-12-2014, 03:01 PM   #9
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
I think this is what he means
 
Old 06-13-2014, 02:22 AM   #10
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
The "Beyond Linux From Scratch" book's Chapter 3 touches on how to set up various color sequences for programs and dialogue in Bash. Check it out and see if it has anything of reference.
 
Old 06-13-2014, 10:46 PM   #11
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
Yea Dj Shaji hit it right on the spot.
 
Old 06-14-2014, 09:03 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
https://wiki.archlinux.org/index.php...rompt_and_Bash
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a palette app with a movable glass to convert text color code into a color? Xl1NntniNH7F Linux - General 2 08-08-2011 01:11 AM
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
Changing Terminal Text Color By Recompiling Kernel kwikness Slackware 6 07-21-2007 11:27 AM
Color background in text mode pistachio Linux - Software 2 05-17-2006 10:24 AM
Chaning color of text using C in CLI mode WindowsBurner Programming 7 11-29-2003 08:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration