Open okravets-intellias opened 3 years ago
Do you know about /docs/Config.md#light-terminal-theme?
If not hopefully that will fix your issue :)
Will that fix everyone else's issues with any custom theme person wants? What if a person likes to switch themes several times a day? Personally I like to switch every other month. Do I need to edit config every time or write my own automation around this?
Currently yes, you'll have to write some script around auto changing the config file. There isn't really a good way of checking if the terminal has a light or a dark background sadly.
Maybe we can implement a shell variable for changing config file location so you can have 2 config file and then you'll only have to change one shell var to change the theme.
Hi, I find the difference between lightTheme: true
and lightTheme: false
is only the color of some fonts. If we can choose a color for these fonts, just like we can choose a color for activeBorderColor
, then it can work good both in light and dark terminal.
Do you know about /docs/Config.md#light-terminal-theme? If not hopefully that will fix your issue :)
Is it possible to support hex color too?
@Cokile No but i think we can quite easily support i will look into it!
@Cokile Can you checkout #1395 ?
@mjarkk I tried the following steps:
clone lazygit to Desktop:
cd ~/Desktop && git clone https://github.com/mjarkk/lazygit.git && git checkout allow-hex-theme-colors
change config to:
gui:
theme:
lightTheme: true
selectedRangeBgColor:
- '#00ff00'
execute go install && go run main.go
The selection background color is not shown at all. However the color is rendered correctly if I change '#00ff00'
to red
.
I'm a newbie to Go, am I doing something wrong?
FYI: OS: MacOS 11.4 Terminal: Alacritty (Latest version) Shell: Fish (Latest version) $TERM: xterm-256color
Yea that's probably because my changes do not work on text.
The library we use for giving text color doesn't support RGB text colours and I'm not yet sure what todo about that 🤔
Maybe we can use one of these libaries to color text as they seem to support rgb colors:
@Cokile can you checkout #1401 it should allow text hex colors to be set
@mjarkk I have tried with selectedRangeBgColor
set to '#ff0000'
and it turns out lazygit works great with hex color. Thanks for the awesome work.
@mjarkk now that your PR is in for the multiple config files thing, I wonder if that means we can close this ticket? I'm not aware of any preference in e.g. iterm2 that lets you set env vars for certain profiles though, so it would need to be something the user automates themselves somehow
I think so. It will require a new instance of the shell whenever you change your system theme but i think you can read the system theme into a shell variable.
On MacOS the system theme can be read using the following:
# Light theme
$ defaults read -g AppleInterfaceStyle
2021-10-17 15:09:39.426 defaults[85381:7976117]
The domain/default pair of (kCFPreferencesAnyApplication, AppleInterfaceStyle) does not exist
# Dark theme
$ defaults read -g AppleInterfaceStyle
Dark
On Linux with Gnome you can read the theme to determine if you are using a dark or light theme:
$ gsettings get org.gnome.desktop.interface gtk-theme
'Pop'
On Windows (Powershell) you probably do something like, tough i haven't tested this
Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme
0 = darkmode
1 = lightmode
Then you can create an alias for lazygit using the new Overriding default config file location
what are your thoughts @okravets-intellias ?
To be honest I like to customize configuration only when I really need to. IMO theme switching is something that can be fully automated even if not for everyone's custom color selection but at least it can have some reasonable defaults. Take a look at tig
for example. It just works with all standard themes I've tried to switch to in iTerm. But of course it's your project and if you think current support is enough you can close this issue.
I'd be interested to see how tig goes about it: there might be some easy way of checking whether the user is in light/dark mode, and we could supply some sensible defaults based on that
I don't think it distinguishes light and dark themes. I may be wrong but I think it uses curses which has support for terminal palette.
I just chime in to support the idea of using the terminal colours. Being not a programmer I don't have any idea how hard it is to implement but it seems to be the way to go to make this wonderful program as readable as possible.
My desktop switches light and dark themes depending on time of date, so when I want to lazygit I have to fire up a special profile
Hi. Thanks for this great program. I found this issue as I was trying to find a way to change the color of the font. I think having a setting for it would solve all problems for me: I'd just set it to gray
and it will work regardless of the terminal theme. Is there an option for this?
Is your feature request related to a problem? Please describe. I have a light theme in my terminal emulator. I can't even try lazygit because apparently it does not know abouth color themes other than default one.
Describe the solution you'd like Support other color schemes.
Describe alternatives you've considered Not using lazygit :(
Additional context this is unusable