Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

urxvt or xterm colour mappings

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
andi456
Apprentice
Apprentice
Posts: 259
Joined: Sun Mar 06, 2005 12:23 pm
Location: Germany

urxvt or xterm colour mappings

  • Quote

Post by andi456 » Sun Mar 22, 2026 10:11 am

Hi,

after some research I finally found a colour scheme for rxvt-unicode called urxvt-solarized https://github.com/jimmysjolund/urxvt-solarized.

But after some time using it, I'd like to adapt some of the colours to my liking. So I looked at the source of urxvt-solarized and basically found pair of (nested) perl hashes. The first obviously maps 16 colour names to hexedecimal colour codes and the second nested one numbers as well as some strings to the (traditional?) colour names as can be seen here: https://github.com/jimmysjolund/urxvt-s ... /solarized

The problem for me arises from the fact that I did not find an explanation what number causes what part of rxvt to be colourized. If I understand it correctly,

Code: Select all

$schemes{"dark"}{0}
points to

Code: Select all

base02
mapped to the colour code

Code: Select all

"#073642"
but how does rxvt understand the 0 key? Maybe someone more familiar with customizing rxvt could shed some light into this.

Kind regards,

Andreas
Top
arran4
n00b
n00b
User avatar
Posts: 18
Joined: Fri Sep 19, 2003 2:53 pm
Location: Melbourne, Australia

  • Quote

Post by arran4 » Sun Mar 22, 2026 11:26 pm

No idea, but I thought the standard way of configuring this was via .Xresources.. According to some random guys file it looks like it can be done:

https://gist.github.com/liangzan/1643690

Not sure if that's helpful
Top
b11n
Guru
Guru
User avatar
Posts: 303
Joined: Wed Mar 26, 2003 8:15 am
Location: New Zealand

  • Quote

Post by b11n » Sun Mar 22, 2026 11:40 pm

{0} is the index to the ANSI color sequences, where {0} would be black, {1} red, {2} green, and so on:

https://gist.github.com/JBlond/2fea43a3 ... efc87b2124
Is there gas in the caaaaar?
Yes, there's gas in the caaaar
Top
andi456
Apprentice
Apprentice
Posts: 259
Joined: Sun Mar 06, 2005 12:23 pm
Location: Germany

  • Quote

Post by andi456 » Mon Mar 23, 2026 9:27 am

As far as I understand it, urxvt uses perl as an extension language and the perl code that I happened to find does not much else than the direct configuration by liangzan in .Xdefaults/.Xresources https://gist.github.com/liangzan/1643690.

But how does urxvt "know" that some colour, say base01, is going to be used as the colour for directories? That's actually the colour that I would like to adapt to my liking as it could be a little more noticeable than the one used by the solarized theme that I found...

Kind regards
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Mon Mar 23, 2026 11:43 am

urxvt doesn't know that base01 will be a directory, because directories are not inherently colored specially. Some popular tools, such as ls, can be told to output color codes for directories (among many other things). The default output of dircolors tells me that DIR is given 01;34. A nearby legend tells me:

Code: Select all

# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
DIR 01;34 # directory
From this, directories are bold and use foreground 34, which most terminals render as blue. They have no explicit background color, so they stay with the default background. I expect this means you want to manipulate base04 in order to change the (usually blue) color used for directories. However, if you tuned LS_COLORS, you could cause directories to use some other foreground code instead, and would then need to adjust the RGB of some color other than base04.
Top
andi456
Apprentice
Apprentice
Posts: 259
Joined: Sun Mar 06, 2005 12:23 pm
Location: Germany

  • Quote

Post by andi456 » Mon Mar 23, 2026 12:53 pm

From what I can tell, there's some kind of overlap between dircolors (I kept the one from coreutils /etc/DIR_COLORS) and the solarized theme for urxvt, because the default colours are not longer used in urxvt. I did not knowingly manipulate LS_COLORS.

It's a little bit confusing to find out, which settings do what...
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Tue Mar 24, 2026 4:02 am

i'd like to take this opportunity to encourage people to expand (or correct!) the wiki's "Terminal emulator/Colors" page with information they know or learn. My experience has been that people often want to configure colour in terminals, but that information about doing so is often scattered ....
https://wiki.gentoo.org/wiki/User:Flexibeast
My most recent wiki contributions
Top
Post Reply

7 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic