CLI program that allows you to change your Alacritty config with one command without editing the config file.

Overview

Pycritty

Change your alacritty config on the fly!

Preview Image

Installation:

pip install pycritty

By default, only the program itself will be installed, but you can install default themes from config/themes:

pip install --install-option="--themes=onedark,dracula,nord" pycritty

Or if you want them all:

pip install --install-option="--themes=all" pycritty

Make sure to have ~/.local/bin directory in your $PATH, otherwise your shell won't find the pycritty command. Add this line to your ~/.xprofile if you haven't already:

export PATH=$HOME/.local/bin:$PATH

Usage:

Change your current config:

pycritty --font UbuntuMono --size 14 --opacity 0.95

Save multiple configs and reuse them later:

pycritty save ThisConfig
pycritty load AnotherConfig

Install themes and configs from URLs:

pycritty install -t https://raw.githubusercontent.com/antoniosarosi/pycritty/master/config/themes/breeze.yaml
pycritty -t breeze
pycritty install -c -n SomeCoolConfig https://raw.githubusercontent.com/antoniosarosi/dotfiles/master/.config/alacritty/config.yaml
pycritty load SomeCoolConfig

Check help for all available options:

pycritty -h
# pycritty subcomand -h
pycritty save -h

Fonts Config

Fonts are configured in ~/.config/alacritty/fonts.yaml with this format:

fonts:
    Alias: Font Name

When applied using pycritty -f Alias, the previous format will be converted into the alacritty equivalent:

font:
    normal:
        family: Font Name
    italic:
        family: Font Name
    bold:
        family: Font Name

You can also specify a different font for each font type:

fonts:
    Alias:
        normal: Normal Font Name
        bold: Bold Font Name
        italic: Italic Font Name

Note that the fonts must be installed on your system.

Theme Config

You can make your own custom themes by creating new theme files with the correct format, ~/.config/alacritty/themes/custom.yaml should look like this:

colors:
    # Default colors
    primary:
        background: '0x292d3e'
        foreground: '0xbbc5ff'
    # Normal colors
    normal:
        black:   '0x101010'
        red:     '0xf07178'
        green:   '0xc3e88d'
        yellow:  '0xffcb6b'
        blue:    '0x82aaff'
        magenta: '0xc792ea'
        cyan:    '0x89ddff'
        white:   '0xd0d0d0'
    # Bright colors
    bright:
        black:   '0x434758'
        red:     '0xff8b92'
        green:   '0xddffa7'
        yellow:  '0xffe585'
        blue:    '0x9cc4ff'
        magenta: '0xe1acff'
        cyan:    '0xa3f7ff'
        white:   '0xffffff'

Then you can apply it using the name of the file:

pycritty -t custom

Custom scripts

If you want to apply different configs programmatically, you can either use the CLI in a shell script or use pycritty as a python module:

#!/bin/python3

# Dummy script that changes the theme every 5 minutes

from time import sleep
from pycritty.commands import Pycritty, ListResource


def main():
    ls = ListResource()
    conf = Pycritty()
    while True:
        for theme in ls.list_themes():
            conf.change_theme(theme)  # or conf.set(theme=theme)
            conf.apply()
            sleep(300)


if __name__ == '__main__':
    main()

Shell equivalent:

#!/bin/bash

while :; do
    # Same as pycritty ls --themes --iterable
    for theme in $(pycritty ls -ti); do
        pycritty -t $theme
        sleep 300
    done
done
You might also like...
Spotify Offline is a command line tool that allows one to download Spotify playlists in MP3 format.

Spotify Offline v0.0.2 listen to your favorite spotify songs, offline Overview Spotify Offline (spotifyoffline) is a command line tool that allows one

This is a CLI program which can help you generate your own QR Code.

Python-QR-code-generator This is a CLI program which can help you generate your own QR Code. Single.py This will allow you only to input a single mess

Command line tool to automate transforming the effects of one color profile to another, possibly more standard one.
Command line tool to automate transforming the effects of one color profile to another, possibly more standard one.

Finished rendering the frames of that animation, and now the colors look washed out and ugly? This terminal program will solve exactly that.

Limit your docker image size with a simple CLI command. Perfect to be used inside your CI process.

docker-image-size-limit Limit your docker image size with a simple CLI command. Perfect to be used inside your CI process. Read the announcing post. I

Zero-config CLI for TypeScript package development
Zero-config CLI for TypeScript package development

Despite all the recent hype, setting up a new TypeScript (x React) library can be tough. Between Rollup, Jest, tsconfig, Yarn resolutions, ESLint, and

Program Command Line Interface (CLI) Sederhana: Pemesanan Nasi Goreng Hekel

Program ini merupakan aplikasi yang berjalan di dalam command line (terminal). Program ini menggunakan built-in library python yaitu argparse yang dapat menerima parameter saat program ini dijalankan melalui terminal atau CLI.

A simple automation script that logs into your kra account and files your taxes with one command

EASY_TAX A simple automation script that logs into your kra account and files your taxes with one command Currently works for Chrome users. Will creat

inklayers is a command line program that exports layers from an SVG file.
inklayers is a command line program that exports layers from an SVG file.

inklayers is a command line program that exports layers from an SVG file. It can be used to create slide shows by editing a single SVG file.

A command-line tool to upload local files and pastebin pastes to your mega account, without signing in anywhere
A command-line tool to upload local files and pastebin pastes to your mega account, without signing in anywhere

A command-line tool to upload local files and pastebin pastes to your mega account, without signing in anywhere

Comments
  • I'm not able to run pycritty, relative imports error and not set pycritty as env variable

    I'm not able to run pycritty, relative imports error and not set pycritty as env variable

    First of all, when I run the command for install everything (pip install --install-option="--themes=all" pycritty) I have no errors but pycritty is not defined as an env variable. I go to the installation path in my case .local/lib/python3.9/site-packages/pycritty and try to run it as a normal python program (python main.py --font UbuntuMono --size 14 --opacity 0.95) And this is the error that shows me, it's like can't do relative imports: Screenshot_17

    I tried to add Pycritty Error on main class for removing the import, but shows the same error with other relative import.

    Any idea about why this is not working well?

    OS: Garuda (based on Arch) Desktop: Qtile

    opened by JarssS8 4
  • [PATCH] Add integration pipeline

    [PATCH] Add integration pipeline

    Add integration pipeline for pull request, this pipeline will run mypy, flake8 and unit tests. I also fixed some files to make the pipeline succeed. Pipeline tested in fork: Screenshot_2022-03-03_00-19-38

    opened by niconunez96 0
  • [PATCH] Add unit testing proposal

    [PATCH] Add unit testing proposal

    Adding a starting test suite only for Cli class and ls functions The idea is to have a test suite that will be triggered on an integration pipeline on every pull request along with mypy checks.

    opened by niconunez96 0
  • Changed deprecated option background_opacity to window.opacity

    Changed deprecated option background_opacity to window.opacity

    In Alacritty Version 0.10.0, the option "background_opacity" in the "alacritty.yml" customization config file is deprecated. This commit fixes the warning raised by this update and updates it to the recommended.

    opened by T1erno 0
Releases(v0.4.0)
Owner
Antonio Sarosi
Average Hacker
Antonio Sarosi
Colab-xterm allows you to open a terminal in a cell

colab-xterm Colab-xterm allows you to open a terminal in a cell. Usage Install package and load the extension !pip install git+https://github.com/popc

InfuseAI 194 Dec 29, 2022
Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more

unit-converter-albert-ext Extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecu

Jonah Lawrence 2 Jan 13, 2022
Commandline script to interact with volkswagencarnet library

volkswagencarnet-client command line script to interact with volkswagencarnet library Table of Contents General Info Setup Usage Example Acknowledgeme

3 Jan 19, 2022
A command line tool to create a graph representing your Ansible playbook tasks and roles

Ansible Playbook Grapher ansible-playbook-grapher is a command line tool to create a graph representing your Ansible playbook plays, tasks and roles.

Mohamed El Mouctar Haidara 424 Dec 20, 2022
Interactive Python interpreter for executing commands within Node.js

Python Interactive Interactive Python interpreter for executing commands within Node.js. This module provides a means of using the Python interactive

Louis Lefevre 2 Sep 21, 2022
πŸ–οΈThis is a feature-complete clone of the awesome Chalk (JavaScript) library.

Terminal string styling done right This is a feature-complete clone of the awesome Chalk (JavaScript) library. All credits go to Sindre Sorhus. Highli

Fabian Keller 132 Dec 27, 2022
Cli tool to browse and play anime

browse and watch anime (scrape from gogoanime) (wip) basically ani-cli but in python cuz python good demo dependencies mpv installation from pypi pip

sheep padowo 2 Apr 20, 2022
dbt-subdocs is a python CLI you can used to generate a dbt-docs for a subset of your dbt project

dbt-subdocs dbt-subdocs is a python CLI you can used to generate a dbt-docs for a subset of your dbt project πŸ€” Description This project is useful if

Jambe 6 Jan 03, 2023
CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM

AWS SAM The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to e

Amazon Web Services 6.2k Jan 08, 2023
βš™ A lightweight command line interface library for creating commands.

βš™ A lightweight command line interface library for creating cli commands. About | Installation | Usage | Features | Contributors | License About Next:

Serum 16 Sep 25, 2022
A helper program to play wordle

A helper program to play wordle

1 Jan 22, 2022
A Terminal UI for Discord

ToastCord ToastCord is a Discord Terminal UI. At the moment you can only look at Direct messages. TODO: - Add support for guilds - Message sending sup

toast 82 Dec 18, 2022
Kattis shell for getting examples, testing and submitting.

Kattis shell for getting examples, testing and submitting.

Simon Green Kristensen 15 Sep 30, 2022
πŸ”– Lemnos: A simple, light-weight command-line to-do list manager.

πŸ”– Lemnos: CLI To-do List Manager This is a simple program that allows one to manage a to-do list via the command-line. Example $ python3 todo.py add

Rohan Sikand 1 Dec 07, 2022
🌈 Beautify your command line interfaces.

Basics Install: pip install iridi Usage: import iridi # Create gradient text # iridi.print(message, colors, options) # Ask for input with gradient

Conrad Crawford 39 Oct 20, 2022
Command Line Manager + Interactive Shell for Python Projects

Manage Command Line Manager + Interactive Shell for Python Projects

Python Manage 123 Aug 28, 2022
texel - Command line interface for reading spreadsheets inside terminal

texel - Command line interface for reading spreadsheets inside terminal. Sometimes, you have to deal with spreadsheets. Those are sad times. Fortunate

128 Dec 19, 2022
An open-source CLI tool for backing up RDS(PostgreSQL) Locally or to Amazon S3 bucket

An open-source CLI tool for backing up RDS(PostgreSQL) Locally or to Amazon S3 bucket

1 Oct 30, 2021
Command line, configuration and persistence utilities

Zensols Utilities Command line, configuration and persistence utilities generally used for any more than basic application. This general purpose libra

Paul Landes 2 Nov 17, 2022
Rdwcli - Car list cli app with python

Rdwcli - Car list cli app with python

Arie Twigt 1 Feb 02, 2022