All Projects → fretboardfreak → kitty-theme-changer

fretboardfreak / kitty-theme-changer

Licence: Apache-2.0 license
Obsolete: use "kitty +kittens themes"

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to kitty-theme-changer

kitty
😽 Soothing pastel theme for Kitty
Stars: ✭ 121 (+365.38%)
Mutual labels:  kitty, kitty-terminal
KittyTerminalImages.jl
A package that allows Julia to display images in the kitty terminal editor
Stars: ✭ 57 (+119.23%)
Mutual labels:  kitty, kitty-terminal
Macos Terminal Themes
Color schemes for default macOS Terminal.app
Stars: ✭ 4,685 (+17919.23%)
Mutual labels:  terminal-themes, color-schemes
SacredUtils
Configuration utility for Sacred & Sacred Underworld with Material Design. Abandoned 05/07/2020.
Stars: ✭ 27 (+3.85%)
Mutual labels:  utilities
dotfiles
🔧 My dotfiles on  macOS for Neovim, Zsh, kitty, lf, etc
Stars: ✭ 90 (+246.15%)
Mutual labels:  kitty
lintje
Lintje is an opinionated linter for Git.
Stars: ✭ 25 (-3.85%)
Mutual labels:  utilities
OrganizeMediaFiles
a collection of Python scripts that help you organize media files into a directory tree "year/month" based on metadata , using exiftool
Stars: ✭ 24 (-7.69%)
Mutual labels:  utilities
tig-colors-neonwolf
Tig color scheme based on badwolf
Stars: ✭ 29 (+11.54%)
Mutual labels:  color-schemes
AutoScreenshot
Automatic screenshot maker for Windows
Stars: ✭ 49 (+88.46%)
Mutual labels:  utilities
rorshach
A watchman for your directories. Rorshach allows you to listen to file system changes and run commands when these events occur.
Stars: ✭ 26 (+0%)
Mutual labels:  utilities
tsafe
🔩 The missing TypeScript utils
Stars: ✭ 285 (+996.15%)
Mutual labels:  utilities
JimmysUnityUtilities
A bunch of code I like to have on hand while working in Unity
Stars: ✭ 93 (+257.69%)
Mutual labels:  utilities
Light-Switch
Easily switch from light to dark theme, or the other way around, in Windows 10/11.
Stars: ✭ 25 (-3.85%)
Mutual labels:  theme-switcher
rebellion
A collection of core libraries for Racket
Stars: ✭ 78 (+200%)
Mutual labels:  utilities
table2ascii
Python library for converting lists to fancy ASCII tables for displaying in the terminal and on Discord
Stars: ✭ 31 (+19.23%)
Mutual labels:  utilities
roku-libs
Compilation of utilities for Roku development
Stars: ✭ 47 (+80.77%)
Mutual labels:  utilities
elixir-utilities-web
Utilties for the Developer. Regex, HTTP echo. Diffing
Stars: ✭ 36 (+38.46%)
Mutual labels:  utilities
alacritty-theme
Collection of Alacritty color schemes
Stars: ✭ 1,773 (+6719.23%)
Mutual labels:  color-schemes
flate
🌈 Colorful dark themes
Stars: ✭ 35 (+34.62%)
Mutual labels:  kitty
sugar
moved to https://git.matthewbutterick.com/mbutterick/sugar
Stars: ✭ 19 (-26.92%)
Mutual labels:  utilities

Kitty Theme Changer

Author: Curtis Sand
author_email:[email protected]
repository:https://github.com/fretboardfreak/kitty-theme-changer.git

Change Kitty Terminal Themes Easily!

Kitty Theme Changer provides simple CLI script that will help you test out and change theme configuration files for the Kitty Terminal Emulator.


Table of Contents:

  1. Installation
  2. Configuration
  3. Tips and Tricks
    1. First Run
    2. Kitty Configuration Tips

For more information on the terminal visit: https://github.com/kovidgoyal/kitty

The Kitty Theme Changer script has been tested with the collection of themes found in the kitty-themes repository: https://github.com/dexpota/kitty-themes

Installation

The recommended method for installing the Kitty Theme Changer is to use pip to install the package into your python environment. This can be done safely inside a python virtual environment or using the --user flag on pip install to install the script in your home directory.

Home directory install:

pip install --user git+git://github.com/fretboardfreak/kitty-theme-changer.git@master

Note that you can install the Kitty Theme Changer into the system's core python installation but I feel that python package management is a bit cleaner if user installed packages are kept out of the system directories.

Inside a Python Virtual Environment:

python -m venv my_python_env
my_python_env/bin/pip install git+git://github.com/fretboardfreak/kitty-theme-changer.git@master

Note

The above URI will install the latest development version of the Kitty Theme Changer. To instead install one of the tagged releases replace @master with @RELEASE where the text RELEASE is the tagged version (e.g. [email protected]).

As an alternative you could clone this repository and execute the script directly. This method would not leverage the setuptools entrypoint and would depend on you ensuring that the script is available in your PATH variable yourself.

Configuration

  1. First step in configuring the Kitty Theme Changer is to download a set of themes for kitty (recommendation: https://github.com/dexpota/kitty-themes).

  2. Second step is to configure kitty to include a theme config file. To do this add the line include ./theme.conf in your kitty.conf file.

  3. Third and final step is to create the Kitty Theme Changer config file which will point to the correct paths for the themes you've collected.

    The Kitty theme changer uses a simple python module as a configuration file. By default this is '~/.kittythemechanger.py'. The list of required variables and their types are:

    • theme_dir (pathlib.Path): Directory of Kitty theme.conf files.
    • conf_dir (pathlib.Path): Directory Kitty looks in for theme.conf
    • theme_link (pathlib.Path): Symlink file Kitty loads from kitty.conf
    • light_theme_link (pathlib.Path): Symlink to a 'light' theme config file.
    • dark_theme_link (pathlib.Path): Symlink to a 'dark' theme config file.
    • socket (str): a Kitty compatible socket string for the '--listen-on' flag. See 'man kitty'.

    An example .kittythemechanger.py file is shown below:

    '''A config module for the Kitty Theme Changer Tool.'''
    from pathlib import Path
    from os import getpid
    from psutil import process_iter
    
    theme_dir = Path('~/kitty-themes/themes').expanduser()
    conf_dir = Path('~/.config/kitty').expanduser()
    theme_link = conf_dir.joinpath('theme.conf')
    light_theme_link = conf_dir.joinpath('light-theme.conf')
    dark_theme_link = conf_dir.joinpath('dark-theme.conf')
    
    def kitty_pid():
      ps = {x.pid: x for x in psutil.process_iter(['name', 'pid', 'ppid'])}
      cp = ps[getpid()]
      while cp.name() != 'kitty':
         cp = cp.parent()
      return cp.pid
    
    socket = 'unix:/tmp/kitty-socket-{}'.format(kitty_pid())
    

Tips and Tricks

First Run

On the first run the Kitty Theme Changer script will randomly choose a theme to set as both the light and dark theme. It does this to create the 3 symlinks in the kitty configuration directory pointed to by the config file. One pointing to a light theme, one pointing to a dark theme and a third that ties the kitty configuration with one of the light or dark links. (kitty.conf -> theme.conf -> light-theme.conf -> actual theme file). You can prevent a random theme from being chosen by creating the light and dark symlink files manually (the file names are set in your Kitty Theme Changer configuration file.) or you can simply set your themes to your preference after the first run.

Kitty Configuration Tips

The main features of the Kitty Theme Changer tool - listing themes, setting a dark or light theme, toggling between configured themes - can be used without any additional tweaks to the Kitty Terminal config.

However, the "--test" and "--live" features require some settings in order to work correctly.

  • Kitty Remote Control: The remote control feature must be turned on. Either with a value of "yes" or a value of "socket-only" to limit remote control commands to only use the socket specified in the "--listen-on" flag when running kitty.

    allow_remote_control yes
    
  • Kitty Socket: Any launchers or aliases that you use to start kitty should include a "--listen-on" option. The socket string that you choose for the "--listen-on" flag should match the socket string in your Kitty Theme Changer configuration file. You can also use "listen_on unix:/tmp/kitty-socket" in kitty.conf

  • Single Instance/Instance Groups: For the "--live" feature to change the color theme for all running windows it is useful to run kitty with the --single-instance option turned on.

    If you want the Kitty Theme Changer to modify only a set of kitty windows then you can make all those windows part of the same Kitty instance using the --instance-group GROUPNAME flag.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].