themes.rst 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Changing kitty colors
  2. ========================
  3. .. only:: man
  4. Overview
  5. --------------
  6. The themes kitten allows you to easily change color themes, from a collection of
  7. over three hundred pre-built themes available at `kitty-themes
  8. <https://github.com/kovidgoyal/kitty-themes>`_. To use it, simply run::
  9. kitten themes
  10. .. image:: ../screenshots/themes.png
  11. :alt: The themes kitten in action
  12. :width: 600
  13. The kitten allows you to pick a theme, with live previews of the colors. You can
  14. choose between light and dark themes and search by theme name by just typing a
  15. few characters from the name.
  16. The kitten maintains a list of recently used themes to allow quick switching.
  17. If you want to restore the colors to default, you can do so by choosing the
  18. ``Default`` theme.
  19. .. versionadded:: 0.23.0
  20. The themes kitten
  21. How it works
  22. ----------------
  23. A theme in kitty is just a :file:`.conf` file containing kitty settings.
  24. When you select a theme, the kitten simply copies the :file:`.conf` file
  25. to :file:`~/.config/kitty/current-theme.conf` and adds an include for
  26. :file:`current-theme.conf` to :file:`kitty.conf`. It also comments out any
  27. existing color settings in :file:`kitty.conf` so they do not interfere.
  28. Once that's done, the kitten sends kitty a signal to make it reload its config.
  29. .. note::
  30. If you want to have some color settings in your :file:`kitty.conf` that the
  31. theme kitten does not override, move them into a separate conf file and
  32. ``include`` it into kitty.conf. The include should be places after the
  33. inclusion of :file:`current-theme.conf` so that the settings in it override
  34. conflicting settings from :file:`current-theme.conf`.
  35. Using your own themes
  36. -----------------------
  37. You can also create your own themes as :file:`.conf` files. Put them in the
  38. :file:`themes` sub-directory of the :ref:`kitty config directory <confloc>`,
  39. usually, :file:`~/.config/kitty/themes`. The kitten will automatically add them
  40. to the list of themes. You can use this to modify the builtin themes, by giving
  41. the conf file the name :file:`Some theme name.conf` to override the builtin
  42. theme of that name. Here, ``Some theme name`` is the actual builtin theme name, not
  43. its file name. Note that after doing so you have to run the kitten and
  44. choose that theme once for your changes to be applied.
  45. Contributing new themes
  46. -------------------------
  47. If you wish to contribute a new theme to the kitty theme repository, start by
  48. going to the `kitty-themes <https://github.com/kovidgoyal/kitty-themes>`__
  49. repository. `Fork it
  50. <https://docs.github.com/en/get-started/quickstart/fork-a-repo>`__, and use the
  51. file :download:`template.conf
  52. <https://github.com/kovidgoyal/kitty-themes/raw/master/template.conf>` as a
  53. template when creating your theme. Once you are satisfied with how it looks,
  54. `submit a pull request
  55. <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`__
  56. to have your theme merged into the `kitty-themes
  57. <https://github.com/kovidgoyal/kitty-themes>`__ repository, which will make it
  58. available in this kitten automatically.
  59. Changing the theme non-interactively
  60. ---------------------------------------
  61. You can specify the theme name as an argument when invoking the kitten to have
  62. it change to that theme instantly. For example::
  63. kitten themes --reload-in=all Dimmed Monokai
  64. Will change the theme to ``Dimmed Monokai`` in all running kitty instances. See
  65. below for more details on non-interactive operation.
  66. .. include:: ../generated/cli-kitten-themes.rst