No description
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| defaults | ||
| meta | ||
| tasks | ||
| README.md | ||
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
- Installs runtime libraries with apt (Debian/Ubuntu):
curl,libgl1,libegl1,libxkbcommon-x11-0. - Runs the official installer, which unpacks kitty to
~/.local/kitty.app. It runs only when kitty is missing, or on every play whenkitty_upgradeistrue. - Symlinks
kittyandkitteninto~/.local/bin. - Copies
kitty.desktopandkitty-open.desktopinto~/.local/share/applicationsand rewrites theirIcon=andExec=lines to absolute paths. - Symlinks
~/.config/kittyto~/.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
~/.dotfilesbefore 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: trueand run the play. The installer replaceskitty.appin place. Existing desktop entries are not overwritten. - PATH:
~/.local/binmust be on your PATH. If it isn't in fish, runfish_add_path ~/.local/bin. - WSL2: if kitty fails to start under WSLg, add
linux_display_server x11to 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