Kitty: Difference between revisions

From NixOS Wiki
Layer-09 (talk | contribs)
m Added categories
Dander (talk | contribs)
m remove unnecessary description (see MoS), clean up heading and outdated configuration
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Kitty is a modern, fast, GPU-based terminal emulator that leverages modern graphics hardware for high performance. It works on macOS and Linux, supporting multiple tabs and windows for managing sessions. Kitty can be extended with scripts, supports Unicode and emojis, and offers extensive customization through its configuration file. It integrates well with the operating system, including features like clipboard support and drag-and-drop functionality. Known for its high performance and responsiveness, Kitty is actively maintained with regular updates.
[https://sw.kovidgoyal.net/kitty/ Kitty] is a modern, fast, GPU-based terminal emulator that leverages modern graphics hardware for high performance.
 
Overall, it is a powerful and flexible terminal emulator for advanced users.


== Installation ==
== Installation ==


==== 2.1 Using nix-shell ====
==== With nix-shell ====
<syntaxhighlight lang="bash" start="3">
<syntaxhighlight lang="bash" start="3">
nix-shell -p kitty
nix-shell -p kitty
</syntaxhighlight>
</syntaxhighlight>


==== 2.2 System-Wide Installation on NixOS ====
==== With NixOS ====
<syntaxhighlight lang="text">
<syntaxhighlight lang="nixos">
environment.systemPackages = [
environment.systemPackages = [
  pkgs.kitty
  pkgs.kitty
];
];
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
sudo nixos-rebuild switch
</syntaxhighlight>
</syntaxhighlight>
== Configuration ==


==== 2.3 User-Specific Installation with Home Manager ====
=== Using NixOS ===
<syntaxhighlight lang="text">
NixOS does not include a module for Kitty, it is necessary to manually replicate the steps from [https://sw.kovidgoyal.net/kitty/conf/ Kitty's official documentation].
home.packages = [
  pkgs.kitty  
];
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
home-manager switch
</syntaxhighlight>


== Configuration ==
=== Using Home Manager ===
{{Note|Currently, configuring Kitty is possible only by using Home Manager.}}


==== 3.1 Basic ====
==== Basic ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.kitty = {
programs.kitty.enable = true;
    enable = true;
};
</syntaxhighlight>
</syntaxhighlight>


==== 3.2 Advanced ====
==== Advanced ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.kitty = lib.mkForce {
programs.kitty = lib.mkForce {
Line 79: Line 67:
== Tips and Tricks ==
== Tips and Tricks ==


==== 4.1 Where to see a list of options? ====
==== Using Stylix to theme Kitty ====
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.kitty.enable Home Manager Options Manual].
[[Stylix]] has a built-in integration for Kitty:<syntaxhighlight lang="nix">
 
==== 4.2 Can this be used with stylix? ====
Yes, it can. See the following configuration:<syntaxhighlight lang="nix">
extraConfig = with config.stylix.base16Scheme; ''
  foreground #${base05}
  background #${base00}
  color0  #${base03}
  color1  #${base08}
  color2  #${base0B}
  color3  #${base09}
  color4  #${base0D}
  color5  #${base0E}
  color6  #${base0C}
  color7  #${base06}
  color8  #${base04}
  color9  #${base08}
  color10 #${base0B}
  color11 #${base0A}
  color12 #${base0C}
  color13 #${base0E}
  color14 #${base0C}
  color15 #${base07}
  color16 #${base00}
  color17 #${base0F}
  color18 #${base0B}
  color19 #${base09}
  color20 #${base0D}
  color21 #${base0E}
  color22 #${base0C}
  color23 #${base06}
  cursor  #${base07}
  cursor_text_color #${base00}
  selection_foreground #${base01}
  selection_background #${base0D}
  url_color #${base0C}
  active_border_color #${base04}
  inactive_border_color #${base00}
  bell_border_color #${base03}
  tab_bar_style fade
  tab_fade 1
  active_tab_foreground  #${base04}
  active_tab_background  #${base00}
  active_tab_font_style  bold
  inactive_tab_foreground #${base07}
  inactive_tab_background #${base08}
  inactive_tab_font_style bold
  tab_bar_background #${base00}
'';
</syntaxhighlight>Stylix can also do it automatically for you. You have to set:<syntaxhighlight lang="nix">
stylix.targets.kitty.enable = true;
stylix.targets.kitty.enable = true;
</syntaxhighlight>
</syntaxhighlight>
==== 4.3 How to map kitty to a key? ====
It depends on the window manager that you are using. On [https://wiki.nixos.org/wiki/Hyprland Hyprland] it's fairly easy:<syntaxhighlight lang="nix">
bind = [
  "$mod, Q, exec, kitty"
];
</syntaxhighlight>
== Troubleshooting ==


== References ==
== References ==

Latest revision as of 19:47, 3 November 2024

Kitty is a modern, fast, GPU-based terminal emulator that leverages modern graphics hardware for high performance.

Installation

With nix-shell

nix-shell -p kitty

With NixOS

environment.systemPackages = [
  pkgs.kitty
];

Configuration

Using NixOS

NixOS does not include a module for Kitty, it is necessary to manually replicate the steps from Kitty's official documentation.

Using Home Manager

Basic

programs.kitty.enable = true;

Advanced

programs.kitty = lib.mkForce {
  enable = true;
  settings = {
    confirm_os_window_close = 0;
    dynamic_background_opacity = true;
    enable_audio_bell = false;
    mouse_hide_wait = "-1.0";
    window_padding_width = 10;
    background_opacity = "0.5";
    background_blur = 5;
    symbol_map = let
      mappings = [
        "U+23FB-U+23FE"
        "U+2B58"
        "U+E200-U+E2A9"
        "U+E0A0-U+E0A3"
        "U+E0B0-U+E0BF"
        "U+E0C0-U+E0C8"
        "U+E0CC-U+E0CF"
        "U+E0D0-U+E0D2"
        "U+E0D4"
        "U+E700-U+E7C5"
        "U+F000-U+F2E0"
        "U+2665"
        "U+26A1"
        "U+F400-U+F4A8"
        "U+F67C"
        "U+E000-U+E00A"
        "U+F300-U+F313"
        "U+E5FA-U+E62B"
      ];
    in
      (builtins.concatStringsSep "," mappings) + " Symbols Nerd Font";
  };
};

Tips and Tricks

Using Stylix to theme Kitty

Stylix has a built-in integration for Kitty:

stylix.targets.kitty.enable = true;

References

  1. https://github.com/kovidgoyal/kitty
  2. https://sw.kovidgoyal.net/kitty/
  3. https://nix-community.github.io/home-manager/options.xhtml#opt-programs.kitty.enable
  4. https://stylix.danth.me/options/hm.html#stylixtargetskittyenable