git clone https://github.com/gaheldev/kitty-gnome-lightdark-mode-switcher.git
cd kitty-gnome-lightdark-mode-switcher
chmod +x install
./install
Uninstall by running ./uninstall
If you want kitty to automatically change catppuccin theme to follow Gnome's light/dark mode run:
set-kitty-mode -m system
It is also possible to set light or dark mode manually with:
set-kitty-mode light # stops tracking of Gnome's mode if active
set-kitty-mode dark # stops tracking of Gnome's mode if active
set-kitty-mode system # use current Gnome's mode without tracking
Currently the catpuccin themes are hardcoded in set-kitty-mode
. You can change them in code and run ./install
.
The current mode in use is tracked by ~/.local/state/TERMINAL_MODE which contains the value 'light' or 'dark'.
For example with neovim, you can add the following code to init.vim:
" use dark mode as default
let terminal_mode = 'dark'
" use the current kitty mode from the local state file TERMINAL_MODE if it exists
" replace <user> with your actual user name
if filereadable('/home/<user>/.local/state/TERMINAL_MODE')[0]
let terminal_mode = readfile('/home/<user>/.local/state/TERMINAL_MODE')[0]
endif
if terminal_mode == 'light'
colorscheme catppuccin-latte
else
colorscheme catppuccin
endif
Get the daemon status:
systemctl --user status kitty-gnome-mode-monitor.service
Enable the daemon to automatically run on startup:
systemctl --user enable kitty-gnome-mode-monitor.service
Start the daemon:
systemctl --user start kitty-gnome-mode-monitor.service
Stop the daemon:
kitty-gnome-mode-monitor -k
systemctl --user stop kitty-gnome-mode-monitor.service