Kitty: Difference between revisions

Layer-09 (talk | contribs)
m Removed numbering
Zimward (talk | contribs)
m Add reference to Stylix as there is currently no wiki page for it
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[https://sw.kovidgoyal.net/kitty/ 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.  
<languages/>
<translate>
<!--T:1-->
'''Kitty''' is a modern, fast, GPU-based terminal emulator written in Python and C. It leverages graphics hardware for high performance and offers features like tabs, layouts, and GPU-based rendering. Kitty is available in the NixOS ecosystem and can be configured through various methods.<ref>https://sw.kovidgoyal.net/kitty/</ref>
</translate>


Overall, it is a powerful and flexible terminal emulator for advanced users.
== Installation ==


== Installation ==


==== Using nix-shell ====
==== Shell ====
<syntaxhighlight lang="bash" start="3">
 
<translate>
<!--T:2-->
To temporarily use Kitty in a shell environment, you can run:
</translate>
<syntaxhighlight lang="bash">
nix-shell -p kitty
nix-shell -p kitty
</syntaxhighlight>
</syntaxhighlight>


==== System-Wide Installation on NixOS ====
<translate>
<syntaxhighlight lang="text">
<!--T:3-->
environment.systemPackages = [
This will provide a shell with Kitty available without adding it to your system configuration.
  pkgs.kitty
</translate>
 
==== System setup ====
 
<translate>
<!--T:4-->
To install Kitty, add it to either the system-wide <code>environment.systemPackages</code> in <code>/etc/nixos/configuration.nix</code> or to the user-specific <code>home.packages</code> in <code>~/.config/nixpkgs/home.nix</code>.<ref>https://nixos.org/manual/nixos/stable/</ref>
</translate>
<syntaxhighlight lang="nix">
# System-wide installation (in /etc/nixos/configuration.nix)
environment.systemPackages = with pkgs; [
  kitty
];
 
# User-specific installation (in ~/.config/nixpkgs/home.nix)
home.packages = with pkgs; [
  kitty
];
];
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
</syntaxhighlight>
 
<translate>
<!--T:5-->
Then, rebuild your system or apply your Home Manager configuration:
</translate>
<syntaxhighlight lang="bash">
# For system-wide installation
sudo nixos-rebuild switch
sudo nixos-rebuild switch
</syntaxhighlight>


==== User-Specific Installation with Home Manager ====
# For Home Manager
<syntaxhighlight lang="text">
home.packages = [
  pkgs.kitty
];
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
home-manager switch
home-manager switch
</syntaxhighlight>
</syntaxhighlight>


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


==== Basic ====
==== Basic ====
<translate>
<!--T:6-->
NixOS does not include a native module for Kitty. For basic Kitty configuration on NixOS, you need to manually follow the steps from Kitty's documentation.<ref>https://sw.kovidgoyal.net/kitty/conf/</ref>
</translate>
<translate>
<!--T:7-->
If you're using Home Manager, you can enable Kitty with a simple configuration:
</translate>
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.kitty = {
programs.kitty.enable = true;
    enable = true;
};
</syntaxhighlight>
</syntaxhighlight>


==== Advanced ====
==== Advanced ====
<translate>
<!--T:8-->
For more advanced Home Manager configuration, you can specify various Kitty settings:
</translate>
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.kitty = lib.mkForce {
programs.kitty = lib.mkForce {
Line 77: Line 115:
</syntaxhighlight>
</syntaxhighlight>


== Tips and Tricks ==
== Tips and tricks ==


==== Where to see a list of options? ====
<translate>
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].
=== Theming with Stylix === <!--T:stylix-->


==== Can this be used with stylix? ====
<!--T:11-->
Yes, it can. See the following configuration:<syntaxhighlight lang="nix">
You can use [[Stylix]]<ref>https://github.com/nix-community/stylix</ref> to theme Kitty by enabling its built-in integration:<ref>https://nix-community.github.io/stylix/options/modules/kitty.html#stylixtargetskittyenable</ref>
extraConfig = with config.stylix.base16Scheme; ''
</translate>
  foreground #${base05}
<syntaxhighlight lang="nix">
  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>


==== How to map kitty to a key? ====
== Troubleshooting ==
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 ==
<translate>
<!--T:10-->
{{Expansion|reason=Section incomplete, needs detailed troubleshooting steps}}
</translate>


== References ==
== References ==


# https://github.com/kovidgoyal/kitty
<references/>
# https://sw.kovidgoyal.net/kitty/
 
# https://nix-community.github.io/home-manager/options.xhtml#opt-programs.kitty.enable
# https://stylix.danth.me/options/hm.html#stylixtargetskittyenable
[[Category:Applications]]
[[Category:Applications]]
[[Category:Terminal]]
[[Category:Terminal]]