Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature suggestion] Modify the colours used by htop #1416

Open
rubyFeedback opened this issue Mar 17, 2024 · 2 comments
Open

[Feature suggestion] Modify the colours used by htop #1416

rubyFeedback opened this issue Mar 17, 2024 · 2 comments
Labels
Linux 🐧 Linux related issues support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.

Comments

@rubyFeedback
Copy link

rubyFeedback commented Mar 17, 2024

I am on manjaro linux right now.

On mate-terminal htop looks like this:

image
(from https://i.imgur.com/cew5MLq.jpeg)

I quite like that for the most part. I assume this is derived from the default local theme.

I do not always use mate-desktop though. Often I just use icewm and KDE, so if I
use, say, another linux distribution, I probably won't have that htop variant in use
anymore. But I would like to re-use it.

This brings me to my question or issue request. Can we customize the colours for
htop, on a per-application basis? That is to allow for overriding the deafult colours.

I don't know if htop makes use of a htoprc file or ENV variables but any change
would be neat. This does not have to be super-complicated, mind you. It can be
kept super-simple, say, only allow for very few values to be customized. Perhaps
a simple colour-profile that is human-readable. This could be specified via a
commandline flag too such as "htop --rcfile=/tmp/foobar.rc" or anything like that.
Or other ways that are simple; I am not requesting a complex and complicated
addition.

I read in other threads that htop uses hardcoded values right now (although, htop
also seems to derive the colours from the theme itself, so it seems to be only semi
hardcoded). So this feature request would also ask for a bit more flexibility - again,
just to keep it simple, nothing too complicated. We don't want to inflate the code base
too much, so simplest-colour support possible (custom colours though).

Htop itself could also bundle, say, six different colour profiles by default, and people
could use it via the commandline too, such as via:

"htop --colour-profile1" or "htop --color-profile=1" # and you can allow colour and color, to not have to care for UK/US spelling differences too
"htop --colour-profile2" or "htop --color-profile=2"

Having default profiles gives people a bit of flexibility. And by limiting it to, say, 6, the
amount of maintenance work is also kept low (you can also put it at 12 or so, or
even lower, say only 3 options, aside from the current default, so the current default
is always available without a need to choose anything else).

@Explorer09
Copy link
Contributor

Explorer09 commented Mar 18, 2024

  1. You might be confused between the htop color scheme and the color palette from your mate-terminal. htop has only a limited set of basic colors (about 16, IIRC) to choose for a color scheme, and the actual "terminal color" to RGB values mapping is done from your mate-terminal (not in the scope of htop).
  2. htop can load a htoprc file from a non-default location by using HTOPRC environment variable. Though there is no option for partial option override.

@BenBE BenBE added support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead. Linux 🐧 Linux related issues labels Mar 19, 2024
@BenBE
Copy link
Member

BenBE commented Mar 19, 2024

There is already support for a set of pre-defined color profiles available in the setup screen. As @Explorer09 mentioned, these use just the 16 primary console colors, which then get mapped to actual RGB colors by your terminal emulator. And while there's roughly a agreed-upon mapping of these colors, there's nothing that prevents your terminal emulator to display color 1 as bright pink instead of the commonly used dark blue …

To answer the questions:

  • No, further support for customizeable profiles instead of the hard-coded ones is unlikely
  • Yes, you can use a different htoprc file, by using the HTOPRC environment variable
  • No, we do not have control how colors will actually display on your screen

To provide a small clarification on how the color themes in htop work: There's a list of enum values that make up what kinds of items we have to color in the UI. Each color profile basically maps the (VGA/VESA) color IDs that each of those UI items should use. That mapping is fully compile-time.

P.S.: Please avoid linking images from other services, as these links may break. Instead embed the image in the post (copy the image to your clipboard and paste it into your text at the right location). This not only avoids images becoming unavailable, but avoids spraying around everyone's data across the internet unnecessarily …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux 🐧 Linux related issues support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.
Projects
None yet
Development

No branches or pull requests

3 participants