No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Paul Provost 73147ec0f1 Support check mode in the installer block
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 12:02:15 -04:00
defaults Initial commit 2026-10-19 04:51:50 -04:00
meta Initial commit 2026-10-19 04:51:50 -04:00
tasks Support check mode in the installer block 2026-10-19 12:02:15 -04:00
README.md Added macOS considerations 2026-10-19 05:02:50 -04:00

kitty

Installs the kitty terminal emulator on Linux using the official installer, and links its configuration from your dotfiles on Linux and macOS.

  • Linux: installs kitty and links the config.
  • macOS: only links the config. kitty itself is installed with Homebrew by a separate role, which should run before this one.
  • Other systems: the role does nothing.

What it does

  1. Installs runtime libraries with apt (Debian/Ubuntu): curl, libgl1, libegl1, libxkbcommon-x11-0.
  2. Runs the official installer, which unpacks kitty to ~/.local/kitty.app. It runs only when kitty is missing, or on every play when kitty_upgrade is true.
  3. Symlinks kitty and kitten into ~/.local/bin.
  4. Copies kitty.desktop and kitty-open.desktop into ~/.local/share/applications and rewrites their Icon= and Exec= lines to absolute paths.
  5. Symlinks ~/.config/kitty to ~/.dotfiles/kitty. A real directory already at that path is moved to ~/.config/kitty.pre-ansible.

Steps 1 to 4 are Linux only; step 5 also runs on macOS. Everything is per user, so only the apt step uses become.

Requirements

  • Ansible 2.12 or newer.
  • A Debian-family distro for the apt step (other distros skip it; install the libraries yourself).
  • OpenGL 3.3 or newer. Under WSL2 this needs WSLg (Windows 11, or a recent Windows 10 with wsl --update).
  • The dotfiles repo checked out at ~/.dotfiles before the config step runs, or the role fails with a clear message.

Variables

Variable Default Purpose
kitty_install_dir ~/.local Parent of kitty.app
kitty_app_dir {{ kitty_install_dir }}/kitty.app Install location
kitty_bin_dir ~/.local/bin Where the kitty and kitten symlinks go
kitty_applications_dir ~/.local/share/applications Where the desktop entries go
kitty_upgrade false Re-run the installer every play to get the latest release
kitty_installer_url https://sw.kovidgoyal.net/kitty/installer.sh Installer source
kitty_apt_packages see defaults/main.yml Runtime libraries for Debian/Ubuntu
kitty_config_wire true Set to false to skip the config symlink on Linux and macOS (for example if stow or chezmoi manages it)
kitty_config_src ~/.dotfiles/kitty Kitty config directory inside your dotfiles
kitty_config_dest ~/.config/kitty Where kitty looks for its config

Example

- hosts: workstations
  roles:
    - role: kitty
      vars:
        kitty_upgrade: false

Run it against a host with --check --diff first to preview the changes.

Notes

  • Upgrades: set kitty_upgrade: true and run the play. The installer replaces kitty.app in place. Existing desktop entries are not overwritten.
  • PATH: ~/.local/bin must be on your PATH. If it isn't in fish, run fish_add_path ~/.local/bin.
  • WSL2: if kitty fails to start under WSLg, add linux_display_server x11 to the kitty config in your dotfiles. The role does not set this, because it would edit your repo.
  • Not tested: the role was written without a live Ansible run. Check it on one host before rolling it out.

Layout

kitty/
├── defaults/main.yml   variables
├── meta/main.yml       role metadata
└── tasks/
    ├── main.yml        OS guards, includes the two files below
    ├── install.yml     Linux only: libraries, installer, symlinks, desktop entries
    └── config.yml      Linux and macOS: dotfiles symlink