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

Color scheme support #2083

Closed
gerion0 opened this issue Oct 20, 2019 · 6 comments
Closed

Color scheme support #2083

gerion0 opened this issue Oct 20, 2019 · 6 comments

Comments

@gerion0
Copy link

gerion0 commented Oct 20, 2019

Is it possible to switch between color schemes in Kitty with a hotkey?
What I have seen is that it is possible to specify a bunch a colors in the config files. However, for a color scheme you have to specify all colors at once so one single hotkey to toggle between schemes seems not to be possible.

I'd like to use this mainly for this purposes:

  • Use a black background with fitting colors as default.
  • Switch to a light scheme, when using the laptop outdoors or in the sun.
  • Switch to a light scheme, when presenting something with the terminal.

As a proposal it may be possible to implement profile support. Konsole has that and (as a more terminal oriented program) mpv, too. It also can be used for more scenarios than color schemes.

Adapting the mpv syntax to kitty in can look like the following:

some_option 1.0
some_other_option 300
profile dark

[dark]
background_color black
color0 ...
color1 ...

[bright]
background_color white
color0 ...
color1 ...

Switching then is possible by calling kitty --profile bright or specifying a hotkey that changes the profile option.

@Luflosi
Copy link
Contributor

Luflosi commented Oct 20, 2019

I think a syntax to specify multiple color schemes would be nice but for now, you can use the remote control feature to change color schemes. See https://github.com/dexpota/kitty-themes#previews for an example on how to do this and also see https://sw.kovidgoyal.net/kitty/remote-control.html on how to enable remote control. Also see https://sw.kovidgoyal.net/kitty/faq.html#how-do-i-change-the-colors-in-a-running-kitty-instance.

@kovidgoyal is it possible to run something like kitty @ set-colors -a "..." with a keyboard shortcut? I thought it was possible but I couldn't find anything on how to do it.

@gerion0
Copy link
Author

gerion0 commented Oct 20, 2019

Whoops, should have read the FAQ (I searched only in the configuration options). Thank you for the hint. Defining an alias for kitty @ set-colors ... is enough for me. However, I leave this bug open as a feature request for profiles and hotkey support.

@kovidgoyal
Copy link
Owner

See #2076 for how to map it via a hotkey

@Luflosi
Copy link
Contributor

Luflosi commented Oct 28, 2019

Can we add support for defining color schemes with names instead of file paths? I think this would be nicer and more user-friendly. The keyboard shortcut could look like map f1 set_colors myAwesomeColorScheme. It would also make it easier to implement support for dark/light mode, which I wanted to implement for a while now.
This could either work as described above or by having each color scheme in a separate file in a directory in the kitty config directory. Which of these options do you prefer? Do you have a better solution? But maybe you prefer to keep the current behaviour.

@gerion0
Copy link
Author

gerion0 commented Oct 28, 2019

As a first point. Thank you, @kovidgoyal for implementing this so fast.

@Luflosi : If you are asking me, I prefer the profile scheme that I have described. The reason lays in the possibility to use the mechanism for other settings groups than color schemes. Maybe one want a profile that not only has light colors but a big font size or a different font or different keymapping etc. With the described mechanism this is possible.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Oct 28, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants