toggle-corp / alacritty-colorscheme

Change colorscheme of alacritty with ease.
Apache License 2.0
343 stars 35 forks source link

Alacritty has changed to TOML format in it's config - so this does not work anymore! #43

Closed emilBeBri closed 5 months ago

emilBeBri commented 8 months ago

As said :)

Here is info from the newest version (arch linux , fully updated)


Created log file at "/tmp/Alacritty-34233.log"
[0.000005726s] [INFO ] [alacritty] Welcome to Alacritty
[0.000069480s] [INFO ] [alacritty] Version 0.13.0 (78fa4d6f)
[0.000079388s] [INFO ] [alacritty] Running on X11
[0.000557672s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/emil/.config/alacritty/alacritty.toml"
[0.012437660s] [INFO ] [alacritty] Using GLX 1.4
akiss-xyz commented 8 months ago

Hey there. Just threw up a PR for this, let me know if that works okay (does the job for me).

You can install it 'from source' like so:

git clone -b feature/move-to-toml git@github.com:akiss-xyz/alacritty-colorscheme-toml.git
cd alacritty-colorscheme-toml
poetry build
cd dist
pip install alacritty_colorscheme-1.0.2-py3-none-any.whl --break-system-packages --force-reinstall

This should net you the new code. To check,

alacritty-colorscheme --version

Should now output 1.0.2.

Hilton-Marques commented 8 months ago

Hi, I tried the above approach, but the following error was raised: image

akiss-xyz commented 8 months ago

Oo, yes. Thanks for catching that, I think it's still by default using a yml config unless you tell it otherwise. Will update in a couple hours!

Hilton-Marques commented 8 months ago

Ok! Let me know when you are done.

akiss-xyz commented 8 months ago

Just updated #44.

Let me know if that works!

Seems ok to me:

image

Hilton-Marques commented 8 months ago

It's working!

akiss-xyz commented 8 months ago

Awesome! Let me know if you need anything else.

I'm likely adding a yml->toml conversion tool as well, to help convert old color schemes over -- really don't want to do that manually for dozens of color schemes.

Hilton-Marques commented 8 months ago

Nice!! It would be nice to have a temporary menu to quickly test the schemes in real time.

akiss-xyz commented 8 months ago

Hmm. Many people have scripts that do that for them.

Here's mine:

themes

'Unix philosophers' will say that that's not this project's job (e.g. this exact discussion in #30).

TLDR:

You can write a script to do that for you.

The one given here (https://github.com/toggle-corp/alacritty-colorscheme/pull/30#issuecomment-1150305617) works great!

akiss-xyz commented 8 months ago

Sorry, just realized I did a pet peeve of mine and didn't actually answer your question.

Copy this into a file (say themes.sh) and run it (sh themes.sh).

#!/usr/bin/env bash
set -euo pipefail

alacritty-colorscheme list |\
    # List of colorscheme files
    fzf --preview "
        # Apply the current selection. fzf puts that 'into' {}.
        alacritty-colorscheme apply {};
        # Display the output of ls so we can check how it looks!
        ls --color=always -la ~"

Should work like so:

using-fzf

Hilton-Marques commented 8 months ago

Perfect! Thanks!

emilBeBri commented 7 months ago

Ok great thanks for being on this!

Hmm I get this when cloning:


emil@t1 ~/Downloads/git-clones % git clone -b feature/move-to-toml git@github.com:akiss-xyz/alacritty-colorscheme-toml.git
Cloning into 'alacritty-colorscheme-toml'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

But no matter if it works for someone else I'll just wait a bit and see

akiss-xyz commented 7 months ago

We can try and debug your SSH connection to Github, or you can feel free to skip to the end and just download the code manually from the website (https://github.com/akiss-xyz/alacritty-colorscheme-toml/tree/feature/move-to-toml).

Debugging SSH

May be a connection issue on your network. Can you ping github.com? Can you access port 22 manually? To try...

telnet github.com 22

It should output something resembling:

Connected to www.github.com.
Escape character is '^]'.
SSH-2.0-xxxxxxxxxxx

You can then quit the telnet shell with Ctrl + ] (aka ^]) followed by Ctrl + D.

Generally, to try and fix your SSH config, first we can test your SSH connection to Github (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection):

ssh -T git@github.com

And then follow the SSH setup guide. https://docs.github.com/en/authentication/connecting-to-github-with-ssh

Just get the files!

If you don't care about SSH, we can just solve this problem by downloading the branch manually from https://github.com/akiss-xyz/alacritty-colorscheme-toml/tree/feature/move-to-toml.

You can download a ZIP file like so: image

emilBeBri commented 7 months ago

Hi thanks for the thorough explanation, sorry for not responding before know.

So I just ended up downloading v 1.0.2 manually. I then build it with:

cd alacritty-colorscheme-toml
poetry build

then, I can see I need pip to install it:

pip install alacritty_colorscheme-1.0.2-py3-none-any.whl --break-system-packages --force-reinstall

I'm on endeavour linux, an arch linux based distro. I have previosly messed up my system by using pip on Arch, so I'm weary about using it - I figure pipx is safer:

pipx install alacritty_colorscheme-1.0.2-py3-none-any.whl --break-system-packages --force-reinstall

however I'm not too happy about the --break-system-packages flag here. I know you probably don't know that, and of course I won't hold you responsible if anything happens, but the risk of breaking my system and spending time fixing it is not worth it. Perhaps I should just wait until it gets updated so I can install it from the main build. Or would you think that it's reasonably safe to install with pipx?

If this is too noob, then feel free to ignore, I respect your time.

emilBeBri commented 5 months ago

Ok I just downloaded it manually and installed it by cd'ing into the dir and running pip install -user. Now everything works again, thanks for fixing it