themes.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. Using your own themes
  30. -----------------------
  31. You can also create your own themes as :file:`.conf` files. Put them in the
  32. :file:`themes` sub-directory of the :ref:`kitty config directory <confloc>`,
  33. usually, :file:`~/.config/kitty/themes`. The kitten will automatically add them
  34. to the list of themes. You can use this to modify the builtin themes, by giving
  35. the conf file the name :file:`Some theme name.conf` to override the builtin
  36. theme of that name. Here, ``Some theme name`` is the actual builtin theme name, not
  37. its file name. Note that after doing so you have to run the kitten and
  38. choose that theme once for your changes to be applied.
  39. Contributing new themes
  40. -------------------------
  41. If you wish to contribute a new theme to the kitty theme repository, start by
  42. going to the `kitty-themes <https://github.com/kovidgoyal/kitty-themes>`__
  43. repository. `Fork it
  44. <https://docs.github.com/en/get-started/quickstart/fork-a-repo>`__, and use the
  45. file :download:`template.conf
  46. <https://github.com/kovidgoyal/kitty-themes/raw/master/template.conf>` as a
  47. template when creating your theme. Once you are satisfied with how it looks,
  48. `submit a pull request
  49. <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`__
  50. to have your theme merged into the `kitty-themes
  51. <https://github.com/kovidgoyal/kitty-themes>`__ repository, which will make it
  52. available in this kitten automatically.
  53. Changing the theme non-interactively
  54. ---------------------------------------
  55. You can specify the theme name as an argument when invoking the kitten to have
  56. it change to that theme instantly. For example::
  57. kitten themes --reload-in=all Dimmed Monokai
  58. Will change the theme to ``Dimmed Monokai`` in all running kitty instances. See
  59. below for more details on non-interactive operation.
  60. .. include:: ../generated/cli-kitten-themes.rst