jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.47k stars 295 forks source link

I have no color at all #703

Closed BarbzYHOOL closed 10 months ago

BarbzYHOOL commented 10 months ago

Why it's not like in the video from the readme or from Brodie https://inv.vern.cc/watch?v=9HzEHrUBQXE ??? for me it has no color, it's just grey

If I add --colors abcde (random letters) it has some colors

$BUKU_COLORS is empty And this command $ buku --colors oKlxm -p does not bring anymore color

What is the issue there??

Note: I installed it with homebrew on Linux

LeXofLeviafan commented 10 months ago

Unlike in Windows, Linux terminal differentiates between empty and unset variables. You can tell the difference by using a substitution, e.g. echo "${BUKU_COLORS+exists}" or echo "${BUKU_COLORS-unset}" (though the latter prints out the value if it's not empty).

Buku v4.8 (the version available in Homebrew) checks for unset BUKU_COLORS only. Perhaps this is the cause?

Otherwise, it might have something to do with your terminal or shell aliases; though that seems less likely.

BarbzYHOOL commented 10 months ago

I'm on fish shell and cannot use these commands. I tried buku in bash (launched from within fish) and it still is all grey

fish: ${ is not a valid variable in fish.
echo "${BUKU_COLORS-unset}"
LeXofLeviafan commented 10 months ago

In the fish shell, set --query BUKU_COLORS || echo unset could be used to perform an equivalent check.

…It seems that running buku with empty BUKU_COLORS actually results in an error, so I'm not sure what could be the actual cause of the issue here. Perhaps your terminal emulator is having difficulties displaying these specific colors for some reason?

Since --colors has some effect for you at least, you can try experimenting with combinations of available values to find whatever works for you. When you've settled on a combination, you can configure it to be set on shell startup in your rcfile – either as a variable export (e.g. export BUKU_COLORS='oKlxm'), or as an alias (e.g. alias buku='buku --colors oKlxm').

BarbzYHOOL commented 10 months ago

Yes, I can do that with env variable, i've already thought about it but I didn't want to spend time looking at all the colors (i tried with "abcde" ^^)

So, it's unset for sure in both terminals. But it may not be related. I switched to Gnome-terminal instead of Tilix, and then it works fine.

So my issue is with tilix, here are some of my settings if anything rings a bell

image image I also use a custom nerd font but disabling it doesn't seem to change anything

BarbzYHOOL commented 10 months ago

Wait, I tried with your colors settings and it gives NOTHING

image

LeXofLeviafan commented 10 months ago

…Yeah, I think I know what your problem is :sweat_smile: palette: Solarized palette: Tango

BarbzYHOOL commented 10 months ago

Ok so it's the palette of color

so as you can see on my first screenshot under the "column background", there are two colors, the one on the right is gray for two of them Same on the right column "foreground". I have no idea what they are for, it's not written anywhere. I dont know if they are default colors.

I can change them and it changes the default output. I have no idea what else it affects

LeXofLeviafan commented 10 months ago

The ANSI terminal spec uses 4-bit colour definition which includes 8 foreground + 8 background colours (i.e. a colour setting is defined as 3 RGB bits + 1 bit for specifying whether to use it for characters or for background); the palette, it would seem, is the 16 colours to be used for displaying equivalent terminal colours (+ optionally 2 more to be used as "default" setting). You can check my 2nd screenshot as a reference as to which colours are which (and your screenshot includes their names)… Honestly, it's pretty weird that this colour scheme shows half of all foreground colours as ‘grey’ :sweat_smile:

I suggest either changing these colours to actually match their names, or switching to a different colour scheme (…or you can do both if you like some of the colours you have right now, I guess).

BarbzYHOOL commented 10 months ago

I just modified them and it looks nice, it's just abstract to me what it does. Thanks for all the help

LeXofLeviafan commented 10 months ago

I just modified them and it looks nice, it's just abstract to me what it does.

“If a script prints out a ‘red’ text on ‘green’ background, here's the colours I want to be displayed on screen.”