Solved vt console change colors theme

Hi guys, :beer: my question about vt() console, is possible to change colors theme somehow?

I mean not change orange to blue, but adjust the color slightly, like for a theme?

EDIT: oh here is example what I mean :D

aV8mg.png
 
Colors are defined in /usr/src/sys/dev/vt/colors/vt_termcolors.c. You could try changing them there and recompile the kernel. I don't think there is an easier way.

But remember that vt(4) only supports 16 colors, so choose wisely.

Anyway please post a screenshot/photo if you try this and it actually works :)
 
Anyway please post a screenshot/photo if you try this and it actually works :)
I was too curious and tried this myself now. It works. The screenshot is from a VirtualBox VM with EFI support enabled.

Here are the colors I used (Zenburn theme):
Code:
static const struct {
	unsigned char r;	/* Red percentage value. */
	unsigned char g;	/* Green percentage value. */
	unsigned char b;	/* Blue percentage value. */
} color_def[16] = {
	{25,	25,	25},	/* black */
	{87,	0,	0},	/* dark red */
	{38,	71,	54},	/* dark green */
	{87,	68,	56},	/* dark yellow */
	{44,	50,	56},	/* dark blue */
	{86,	55,	76},	/* dark magenta */
	{55,	82,	83},	/* dark cyan */
	{86,	86,	80},	/* light gray */

	{44,	56,	50},	/* dark gray */
	{86,	64,	64},	/* light red */
	{76,	75,	62},	/* light green */
	{94,	87,	68},	/* light yellow */
	{58,	75,	95},	/* light blue */
	{93,	58,	83},	/* light magenta */
	{58,	88,	89},	/* light cyan */
	{100,	100,	100},	/* white */
};
This only works if you use i915kms, radeonkms, or efifb (i.e. boot from UEFI). If you use vt's VGA mode standard colors are used.
 

Attachments

  • vtcolors.png
    vtcolors.png
    27.4 KB · Views: 5,580
Heyy, thanks tobik!! I made one for dark mode of http://ethanschoonover.com/solarized

It works :D:D:D

Code:
static const struct {
unsigned char r; /* Red percentage value. */
unsigned char g; /* Green percentage value. */
unsigned char b; /* Blue percentage value. */
} color_def[16] = {
{2,21,25},
{86,19,18},
{52,60,0},
{70,53,0},
{14,54,82},
{82,21,50},
{16,63,59},
{39,48,51},

{0,16,21},
{79,29,8},
{34,43,45},
{39,48,51},
{51,58,58},
{42,44,76},
{57,63,63},
{99,96,89},
};
 
Since rS327444 it's now possible to specify colors in /boot/loader.conf directly, so this has become a lot easier to do. :)

My Zenburn-like theme from above:
Code:
# black
kern.vt.color.0.rgb="#3a3a3a"
# dark red
kern.vt.color.1.rgb="#e89393"
# dark green
kern.vt.color.2.rgb="#688060"
# dark yellow
kern.vt.color.3.rgb="#f0dfaf"
# dark blue
kern.vt.color.4.rgb="#93b3a3"
# dark magenta
kern.vt.color.5.rgb="#bca3a3"
# dark cyan
kern.vt.color.6.rgb="#93b3a3"
# light gray
kern.vt.color.7.rgb="#cccccc"
# dark gray
kern.vt.color.8.rgb="#222222"
# light red
kern.vt.color.9.rgb="#dca3a3"
# light green
kern.vt.color.10.rgb="#7f9f7f"
# light yellow
kern.vt.color.11.rgb="#efef8f"
# light blue
kern.vt.color.12.rgb="#8cd0d3"
# light magenta
kern.vt.color.13.rgb="#c0bed1"
# light cyan
kern.vt.color.14.rgb="#8cd0d3"
# white
kern.vt.color.15.rgb="#ffffff"
 
I tried with Solarized Dark and after reboot it doesn't have any effect. Something missing?
/boot/loader.conf:
Code:
kern.vty=vt
i915kms_load="YES"
fuse_load="YES"

# brightness control
acpi_video_load="YES"

# Solarized Dark
kern.vt.color.0.rgb="#002831"
kern.vt.color.1.rgb="#d11c24"
kern.vt.color.2.rgb="#738a05"
kern.vt.color.3.rgb="#a57706"
kern.vt.color.4.rgb="#2176c7"
kern.vt.color.5.rgb="#c61c6f"
kern.vt.color.6.rgb="#259286"
kern.vt.color.7.rgb="#708284"
kern.vt.color.8.rgb="#001e27"
kern.vt.color.9.rgb="#bd3613"
kern.vt.color.10.rgb="#475b62"
kern.vt.color.11.rgb="#536870"
kern.vt.color.12.rgb="#708284"
kern.vt.color.13.rgb="#5956ba"
kern.vt.color.14.rgb="#819090"
kern.vt.color.15.rgb="#fcf4dc"
 
Sorry for not stating this explicitly before: The loader.conf method won't work on 11.1-RELEASE or earlier.

You need a recent FreeBSD 11-STABLE (or 11.2-RELEASE when it's out) or CURRENT.
 
Back
Top