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
Ipylivebash - Run shell script in Jupyter with live output

ipylivebash ipylivebash is a library to run shell script in Jupyter with live ou

Ben Lau 6 Aug 27, 2022
A command-line utility that, given a markdown file, checks whether all its links work.

A command-line utility written in Python that checks validity of links in a markdown file.

Teclado 2 Dec 08, 2021
Format click help output nicely with rich.

rich-click Format click help output nicely with Rich. Click is a "Python package for creating beautiful command line interfaces". Rich is a "Python li

Phil Ewels 333 Jan 02, 2023
GanTTY - Project planning from the terminal

GanTTY - Project planning from the terminal

Timeo Sam Pochin 161 Dec 26, 2022
Ralph is a command-line tool to fetch, extract, convert and push your tracking logs from various storage backends to your LRS or any other compatible storage or database backend.

Ralph is a command-line tool to fetch, extract, convert and push your tracking logs (aka learning events) from various storage backends to your

France Université Numérique 18 Jan 05, 2023
Rdwcli - Car list cli app with python

Rdwcli - Car list cli app with python

Arie Twigt 1 Feb 02, 2022
A command line utility to export Google Keep notes to markdown.

Keep-Exporter A command line utility to export Google Keep notes to markdown files with metadata stored as a frontmatter header. Supports exporting: S

Nathan Beals 85 Dec 17, 2022
A communist shell written in Python

kash A communist shell written in Python It doesn't support escapes, quotes, comment lines, |, &&, , or similar yet. If you need help, get it from

Çınar Yılmaz 1 Dec 10, 2021
jenkins-tui is a terminal based user interface for Jenkins.

jenkins-tui 📦 jenkins-tui is a terminal based user interface for Jenkins. 🚧 ⚠️ This app is a prototype and in very early stages of development. Ther

Craig Gumbley 22 Oct 24, 2022
A multipurpose discord bot with more than 220 commands

Welcome WM Bot A advanced bot with more than 220 commands to fit your needs Explore the commands » View Demo · Report Bug · Request Feature Table of C

Wasi Master 12 Dec 16, 2022
Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juniper Command System is a Micro CLI Tool that allows you to manage your files, launch applications, as well as providing extra tools for OS Management.

Juan Carlos Juárez 1 Feb 02, 2022
gcptree - Like the unix tree command but for GCP Org Heirarchy

gcptree Like the unix tree command but for GCP Org Heirarchy. For a note on coloring, the org node is green, folders and blue, and projects that are n

Ryan Canty 25 Sep 06, 2022
Python CLI vm manager for remote access of docker images via noVNC

vmman is a tool to quickly boot and view docker-based VMs running on a linux server through noVNC without ssh tunneling on another network.

UCSD Engineers for Exploration 1 Nov 29, 2021
Create argparse subcommands with decorators.

python-argparse-subdec This is a very simple Python package that allows one to create argparse's subcommands via function decorators. Usage Create a S

Gustavo José de Sousa 7 Oct 21, 2022
Analysis of a daily word game "Wordle"

Wordle Analysis of a daily word game "Wordle" https://www.powerlanguage.co.uk/wordle/ Description Worlde is a daily word game in which a player attemp

Bartek 1 Feb 07, 2022
AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Rafael Torres 2 Dec 10, 2021
An awesome Python wrapper for an awesome Docker CLI!

An awesome Python wrapper for an awesome Docker CLI!

Gabriel de Marmiesse 303 Jan 03, 2023
WebApp Maker make web apps (Duh). It is open source and make with python and shell.

WebApp Maker make web apps (Duh). It is open source and make with python and shell. This app can take any website and turn it into an app. I highly recommend turning these few websites into webapps:

2 Jan 09, 2022
QueraToCSV is a simple python CLI project to convert the Quera results file into CSV files.

Quera is an Iranian Learning management system (LMS) that has an online judge for programming languages. Some Iranian universities use it to automate the evaluation of programming assignments.

Amirmahdi Namjoo 16 Nov 11, 2022
Wordle-solver - A tool that helps people who struggle with vocabulary to enjoy the famous game of WORDLE

Wordle-Solver Wordle-Solver helps people who struggle with vocabulary to enjoy t

Jason Chao 104 Dec 31, 2022