Git Product home page Git Product logo

alacritty-colorscheme's People

Contributors

adityakhatri avatar fredericboileau avatar frozenhelium avatar monofox avatar moreheadm avatar phanirithvij avatar thenav56 avatar tnagorra avatar zebradil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alacritty-colorscheme's Issues

Failed to synchronise neovim with alacritty

I believe I have followed the steps in the readme correctly, but neovim is still not using alacritty's settings. I have cloned the aaron-williamson-alacritty-theme repo into my home directory.
alacritty-colorscheme -C ~/.aaron-williamson-alacritty-theme/colors/ -a base16-gruvbox-dark-hard-256.yml works as expected. However, when adding the -V option to the last command, neovim states the following errors:

Error detected while processing /home/dominic/.vimrc_background:
line    2:
E185: Cannot find color scheme 'base16-gruvbox-dark-hard-256'
Error detected while processing function lightline#update[5]..lightline#colorscheme[12]..lightl
ine#highlight:
line   18:
E421: Colour name or number not recognised: ctermfg= ctermbg= term=bold cterm=bold gui=bold
Error detected while processing function lightline#update:
line    5:
E171: Missing :endif

I have installed neovim-remote and I have also added the following to my init.vim:

if filereadable(expand("~/.vimrc_background"))
  let base16colorspace=256          " Remove this line if not necessary
  source ~/.vimrc_background
endif

and these lines to my .bashrc:

function reload_nvim {
    for SERVER in $(nvr --serverlist); do
        nvr -cc "source ~/.config/nvim/init.vim" --servername $SERVER &
    done
}

COLOR_DIR="$HOME/.aaron-williamson-alacritty-theme/colors"
LIGHT_COLOR='base16-gruvbox-light-soft.yml'
DARK_COLOR='base16-gruvbox-dark-soft.yml'

alias day="alacritty-colorscheme -C $COLOR_DIR -a $LIGHT_COLOR -V && reload_nvim"
alias night="alacritty-colorscheme -C $COLOR_DIR -a $DARK_COLOR -V && reload_nvim"

The day/night snippets are not working, unfortunately.

Issue with cli.py

Hi,
When calling cli.py from python 3.9 on MacOS, I get the error below:

Traceback (most recent call last):
  File "/Users/noahgaertner/Library/Python/3.9/lib/python/site-packages/alacritty_colorscheme/cli.py", line 9, in <module>
    from . import __version__
ImportError: attempted relative import with no known parent package

How do I fix this? Is it a bug that's 3.9 specific?

AttributeError: __args__ on startup

If I start the program, it crashes with an AttributeError. This is because of a failed import of tap, see issue swansonk14/typed-argument-parser#55.

I worked around it by changing my installed tap:

--- tap.py.orig 2021-06-06 23:22:00.000000000 +0200
+++ tap.py      2021-06-06 23:19:41.000000000 +0200
@@ -32,7 +32,8 @@


 # Constants
-EMPTY_TYPE = get_args(List)[0] if len(get_args(List)) > 0 else tuple()
+# EMPTY_TYPE = get_args(List)[0] if len(get_args(List)) > 0 else tuple()
+EMPTY_TYPE = tuple()
 BOXED_COLLECTION_TYPES = {List, list, Set, set, Tuple, tuple}
 OPTIONAL_TYPES = {Optional, Union}
 BOXED_TYPES = BOXED_COLLECTION_TYPES | OPTIONAL_TYPES

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

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

256 themes not availible by name in nvim

Calling the -V option generates a .vimrc_background which does not take into account that the base16-vim doesn't use -256 naming convention, but the let base16colorspace=256 option. Striping "-256" from the name would fix that. Something like this?

For example:
alacritty-colorscheme -V apply base16-onedark-256.yml needs a colorscheme base16-onedark, not colorscheme base16-onedark-256

Happens on 1.0.1 arch

Bad configuration file

$ alacritty-colorscheme -C ~/alacritty-theme/themes -l
base16_default_dark.yaml
challenger_deep.yaml
darcula.yaml
dracula.yaml
falcon.yaml
gruvbox_dark.yaml
gruvbox_light.yaml
high_contrast.yaml
hyper.yaml
iterm.yaml
low_contrast.yaml
material_theme.yaml
nord.yaml
one_dark.yaml
papercolor_light.yaml
pencil_dark.yaml
pencil_light.yaml
snazzy.yaml
solarized_dark.yaml
solarized_light.yaml
taerminal.yaml
terminal_app.yaml
tomorrow_night.yaml
tomorrow_night_bright.yaml
wombat.yaml
xterm.yaml

$ alacritty-colorscheme -C ~/alacritty-theme/themes -T
Bad configuration file.

neovim detection on MacOS fails

The file vim.py contains the following code:

    folders = [f for f in listdir('/tmp') if f.startswith('nvim')]

On MacOS, there are no files in /tmp that start with nvim while nvim is running. Instead, the socket file is in /var/folders/40/[REDACTED]/T/nvimegTUh6/0. This means the script fails to detect neovim instances. This directory happens to be in the TMPDIR environment variable. The following change fixed the problem for me:

--- vim.py.orig	2021-06-07 08:19:43.000000000 +0200
+++ vim.py	2021-06-07 08:21:15.000000000 +0200
@@ -1,4 +1,4 @@
-from os import listdir
+from os import listdir, environ
 from os.path import join
 from pynvim import attach

@@ -14,11 +14,12 @@
 def _get_all_instances():
     instances = []

-    folders = [f for f in listdir('/tmp') if f.startswith('nvim')]
+    tmpdir = environ.get('TMPDIR','/tmp')
+    folders = [f for f in listdir(tmpdir) if f.startswith('nvim')]
     for folder in folders:
-        dc = listdir(join('/tmp', folder))
+        dc = listdir(join(tmpdir, folder))
         if '0' in dc:
-            instances.append(join('/tmp', folder, '0'))
+            instances.append(join(tmpdir, folder, '0'))

     return instances



TypeError: TypeError: 'NoneType' object is not subscriptable

It doesn't matter which command I execute, or rather try to. I always get an error message that says:

TypeError: 'NoneType' object is not subscriptable

Listing the installed themes works, when I go to apply one though this happens:

blink@rosie:~$ alacritty-colorscheme -a pencil_dark.yaml
Traceback (most recent call last):
  File "/home/blink/.local/bin/alacritty-colorscheme", line 8, in <module>
    sys.exit(main())
  File "/home/blink/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 226, in main
    replace_colorscheme(colors_path, args.config_file,
  File "/home/blink/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 155, in replace_colorscheme
    if config_yaml['colors']:
TypeError: 'NoneType' object is not subscriptable

Crash when using --list-available with no colorschemes installed

Having just done pip install alacritty-colorscheme and nothing else, running alacritty-colorscheme -l produces the following output.

> alacritty-colorscheme -l
Traceback (most recent call last):
  File "/home/jscdev/bin/alacritty-colorscheme", line 8, in <module>
    sys.exit(main())
  File "/home/jscdev/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 218, in main
    files = get_files_in_directory(args.colorscheme_dir)
  File "/home/jscdev/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 101, in get_files_in_directory
    onlyfiles = [f for f in (listdir(expanded_path))
FileNotFoundError: [Errno 2] No such file or directory: '/home/jscdev/.config/alacritty/colors/'

The version installed by pip is 0.2.1.

Obviously, this bug is incredibly minor, and has no practical effect on the user, but I thought it would probably be worth reporting it anyway.

Requires python 3.8 but pyproject.toml has 3.6

python = "^3.6"

timothy@yoga ~/.c/alacritty> alacritty-colorscheme list
Traceback (most recent call last):
  File "/home/timothy/.local/bin/alacritty-colorscheme", line 6, in <module>
    from alacritty_colorscheme.cli import main
  File "/home/timothy/.local/lib/python3.7/site-packages/alacritty_colorscheme/cli.py", line 5, in <module>
    from typing import List, Optional, Literal, cast
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

https://stackoverflow.com/questions/61206437/importerror-cannot-import-name-literal-from-typing

Synchronisation with vim 8.2 fails

I followed the instructions at PyPi to successfully install the programme. I would also like to synchronise vim. I started by installing the base16-vim plug-in, adding the following snipets to .vimrc:

" Base16 colour schemes
Plugin 'chriskempson/base16-vim'
if filereadable(expand("~/.vimrc_background"))
  let base16colorspace=256          " Remove this line if not necessary
  source ~/.vimrc_background
endif

After which :VundleInstall completed successfully.

Then I generated the ~/.vimrc_background file:

$ alacritty-colorscheme -C ~/.config/alacritty/colors -V apply base16-tomorrow-night-256.yml

$ cat ~/.vimrc_background 
if !exists('g:colors_name') || g:colors_name != 'base16-tomorrow-night-256'
  colorscheme base16-tomorrow-night-256

But then vim complains at startup:

$ vim
Error detected while processing /home/duque004/.vimrc[51]../home/duque004/.vimrc_background:
line    2:
E185: Cannot find color scheme 'base16-tomorrow-night-256'
Press ENTER or type command to continue

It looks some configuration step is missing, but I do not know which.

Thank you.

Error with bashrc

I applied the bashrc aliases to my bashrc after installing and I am getting this type of error below

image

what should I do?

Support for sharkpd/bat

Hey there, I like your script. Is there a way to add support for bat somehow? When I have a light theme enabled bat still uses white letters, which aren't visible then...

This can be done by exporting BAT_THEME as described in the help/man.

Would be nice!

toggle between colorschemes not working

Hi, so I just installed this, on an up-to-date manjaro linux distro.

pip install --user alacritty-colorscheme

colorschemes:

REPO=https://github.com/eendroroy/alacritty-theme.git
git clone $REPO $HOME/.config/alacritty/colors

but when I run

alacritty-colorscheme -V toggle

No colorscheme is changing, and this is the output from terminal:

Traceback (most recent call last):
File "/home/emil/.local/bin/alacritty-colorscheme", line 8, in
sys.exit(main())
File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 158, in main
handle_args(args)
File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 121, in handle_args
colorscheme = get_applied_colorscheme(args.config_file)
File "/home/emil/.local/lib/python3.10/site-packages/alacritty_colorscheme/colorscheme.py", line 32, in get_applied_colorscheme
has_comment = _has_comment_token(config_yaml['colors'].ca.comment)
TypeError: 'NoneType' object is not subscriptable

Not really sure what to do about that - I emptied my alacritty.yml just to make sure that something wasn't interferring (at first I got an error because I already had a section in the yaml defining colorschemes)

Can't apply scheme: KeyError: 'colors'

I'm on Ubuntu 18.04 and installed the package with pip3 install --user alacritty-colorscheme

[I] ➜ alacritty-colorscheme -l | grep nord
nord.yaml

But:

[I] ➜ alacritty-colorscheme -a nord.yaml
Traceback (most recent call last):
  File "/home/glaux/.local/bin/alacritty-colorscheme", line 11, in <module>
    sys.exit(main())
  File "/home/glaux/.local/lib/python3.6/site-packages/alacritty_colorscheme/cli.py", line 195, in main
    args.colorscheme, args.base16_vim)
  File "/home/glaux/.local/lib/python3.6/site-packages/alacritty_colorscheme/cli.py", line 143, in replace_colorscheme
    config_yaml['colors'].update(colors_yaml['colors'])
  File "/home/glaux/.local/lib/python3.6/site-packages/ruamel/yaml/comments.py", line 753, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 'colors'

Here is my nord.yml. I have added the surrounding # color_start/end according to #6

# color_start
colors:
  # Default colors
  primary:
    background: '0x2E3440'
    foreground: '0xD8DEE9'

  # Normal colors
  normal:
    black:   '0x3B4252'
    red:     '0xBF616A'
    green:   '0xA3BE8C'
    yellow:  '0xEBCB8B'
    blue:    '0x81A1C1'
    magenta: '0xB48EAD'
    cyan:    '0x88C0D0'
    white:   '0xE5E9F0'

  # Bright colors
  bright:
    black:   '0x4C566A'
    red:     '0xBF616A'
    green:   '0xA3BE8C'
    yellow:  '0xEBCB8B'
    blue:    '0x81A1C1'
    magenta: '0xB48EAD'
    cyan:    '0x8FBCBB'
    white:   '0xECEFF4'
# color_end

KeyError: 'colors' in case "colors" is not defined in alacritty configuration file

Config file contains following information (dict):

{
   "cursor" : {
      "style" : "Beam"
   },
   "font" : {
      "bold" : {
         "family" : "DejaVu Sans Mono for Powerline",
         "style" : "bold"
      },
      "italic" : {
         "family" : "DejaVu Sans Mono for Powerline",
         "style" : "italic"
      },
      "normal" : {
         "family" : "DejaVu Sans Mono for Powerline"
      },
      "size" : 10
   },
   "shell" : {
      "args" : [
         "-l"
      ],
      "program" : "/bin/fish"
   }
}

Executing:

alacritty-colorscheme -C /home/mono/.config/alacritty/alacritty-theme/themes -t solarized_light.yaml solarized_dark.yaml

Results in:

Traceback (most recent call last):
  File "/home/mono/.local/bin/alacritty-colorscheme", line 8, in <module>
    sys.exit(main())
  File "/home/mono/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 235, in main
    replace_colorscheme(colors_path, args.config_file,
  File "/home/mono/.local/lib/python3.8/site-packages/alacritty_colorscheme/cli.py", line 155, in replace_colorscheme
    if config_yaml['colors']:
  File "/usr/lib/python3.8/site-packages/ruamel/yaml/comments.py", line 753, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 'colors'

Issue here:

if config_yaml['colors']:

It should be catched via try / except KeyError instead of "if" (this would be the pythonic way)

unable to set theme without colors key in alacritty.yaml

Traceback (most recent call last):
  File "/home/ac/.local/bin/alacritty-colorscheme", line 8, in <module>
    sys.exit(main())
  File "/home/ac/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 158, in main
    handle_args(args)
  File "/home/ac/.local/lib/python3.10/site-packages/alacritty_colorscheme/cli.py", line 147, in handle_args
    replace_colorscheme(colors_path, args.config_file,
  File "/home/ac/.local/lib/python3.10/site-packages/alacritty_colorscheme/colorscheme.py", line 72, in replace_colorscheme
    config_yaml['colors'].update(colors_yaml['colors'])
TypeError: 'NoneType' object is not subscriptable

Add license

Please consider releasing this under a license so potential users will be clear on the terms of use and copying.

enable applying theme by name without knowing its file extension

I just tried using this and despite a bit confusing README, usage is very simple, except for the fact that some themes have .yaml extension and some have .yml extension, and I don't want to remember which one has which, or type whole path by hand, so for myself I just stripped extensions from theme filenames and it works, but for everyone else I believe that it would be nice to be able to change theme without having to specify extension, it seems easy to add this without having to change much else in code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.