Skip to content

Commit 11619e1

Browse files
authored
Merge pull request #19 from toggle-corp/feature/add-typings
Change argparse to tap
2 parents 7ea8317 + 34e74d9 commit 11619e1

File tree

9 files changed

+597
-373
lines changed

9 files changed

+597
-373
lines changed

README.md

Lines changed: 67 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,60 @@
11
# Alacritty Colorscheme
22

3-
Change colorscheme of alacritty with ease.
4-
5-
![Usage](https://user-images.githubusercontent.com/4928045/38159826-c451861a-34d0-11e8-979b-34b67027fb87.gif)
6-
7-
## Usage
8-
9-
```
10-
usage: alacritty-colorscheme [-h] (-s | -l | -a colorscheme | -t colorschemes [colorschemes ...] | -T) [-r] [-c configuration file] [-C colorscheme directory] [-V]
3+
![PyPI](https://img.shields.io/pypi/v/alacritty-colorscheme) ![PyPI - Downloads](https://img.shields.io/pypi/dm/alacritty-colorscheme)
114

125
Change colorscheme of alacritty with ease.
136

14-
optional arguments:
15-
-h, --help show this help message and exit
16-
-s, --show-applied Show applied colorscheme
17-
-l, --list-available List available colorschemes
18-
-a colorscheme, --apply colorscheme
19-
Apply colorscheme
20-
-t colorschemes [colorschemes ...], --toggle colorschemes [colorschemes ...]
21-
Toggle colorschemes
22-
-T, --toggle-available
23-
Toggle all available colorschemes
24-
-r, --reverse-toggle Toggle through colorschemes in reverse order
25-
-c configuration file, --config-file configuration file
26-
Path to configuration file
27-
-C colorscheme directory, --colorscheme-directory colorscheme directory
28-
Path to colorscheme directory
29-
-V, --base16-vim Support base16-vim
30-
```
7+
![Usage](https://user-images.githubusercontent.com/4928045/106160031-8267a880-61ad-11eb-9acf-b9d5cd5de3e4.gif)
318

329
## Installation
3310

34-
You can install it from pip:
11+
You can install alacritty-colorscheme using pip:
3512

3613
```bash
3714
pip install --user alacritty-colorscheme
3815
```
3916

40-
## Running locally
41-
42-
```bash
43-
# Install poetry
44-
pip install --user poetry
45-
46-
# Get program
47-
git clone https://github.com/toggle-corp/alacritty-colorscheme.git
17+
## Usage
4818

49-
# Run program
50-
cd alacritty-colorscheme
51-
poetry install
52-
poetry run python alacritty_colorscheme/cli.py
19+
```
20+
usage: alacritty-colorscheme [-c configuration file] [-C colorscheme directory] [-V] [-h]
21+
{list,status,toggle,apply} ...
5322
```
5423

55-
## Getting themes
24+
## Getting colorschemes
5625

57-
You can get themes from [aaron-williamson/base16-alacritty](https://github.com/aaron-williamson/base16-alacritty)
26+
- You can get colorschemes from [aaron-williamson/base16-alacritty](https://github.com/aaron-williamson/base16-alacritty)
5827

59-
```bash
60-
DEST="$HOME/.aaron-williamson-alacritty-theme"
28+
```bash
29+
REPO="https://github.com/aaron-williamson/base16-alacritty.git"
30+
DEST="$HOME/.aarors-williamson-colorschemes"
6131

62-
# Get themes
63-
git clone https://github.com/aaron-williamson/base16-alacritty.git $DEST
64-
```
32+
# Get colorschemes
33+
git clone $REPO $DEST
34+
# Create symlink at default colors location (optional)
35+
ln -s "$DEST/colors" "$HOME/.config/alacritty/color"
36+
```
6537

66-
You can alternatively get themes from from [eendroroy/alacritty-theme](https://github.com/eendroroy/alacritty-theme)
38+
- You can also get colorschemes from from [eendroroy/alacritty-theme](https://github.com/eendroroy/alacritty-theme)
6739

68-
```bash
69-
DEST="$HOME/.eendroroy-alacritty-theme"
40+
```bash
41+
REPO=https://github.com/eendroroy/alacritty-theme.git
42+
DEST="$HOME/.eendroroy-colorschemes"
43+
# Get colorschemes
44+
git clone $REPO $DEST
45+
# Create symlink at default colors location (optional)
46+
ln -s "$DEST/themes" "$HOME/.config/alacritty/color"
47+
```
7048

71-
# Get themes
72-
git clone https://github.com/eendroroy/alacritty-theme.git $DEST
73-
```
74-
75-
## Synchronizing with vim/neovim
49+
## Sync with vim/neo-vim
7650

7751
If you are using base16 colorschemes from
78-
[base16-vim](https://github.com/chriskempson/base16-vim), you can use the `-V`
79-
argument to generate `~/.vimrc_background` file when you change alacritty
80-
colorscheme.
52+
[base16-vim](https://github.com/chriskempson/base16-vim) plugin, you can use
53+
the `-V` argument to automatically generate `~/.vimrc_background` file when you
54+
change alacritty colorscheme. You will need to source this file in your vimrc
55+
to load the same colorscheme in vim.
8156

82-
You will need to source the file in your vimrc to load the appropriate
83-
colorscheme in vim. Add the following in your vimrc file:
57+
Add this in your `.vimrc` file:
8458

8559
```vim
8660
if filereadable(expand("~/.vimrc_background"))
@@ -89,63 +63,61 @@ if filereadable(expand("~/.vimrc_background"))
8963
endif
9064
```
9165
92-
After changing alacritty colorscheme, you need to simply reload your vimrc
93-
configuration.
66+
When you change your alacritty colorscheme, you simply need to source
67+
`~/.vimrc_background` or your `vimrc`.
68+
If you are a neo-vim user, `~/.vimrc_background` will be automatically sourced.
9469
95-
### Reloading neovim
70+
## Examples
9671
97-
If you are using neovim, you can use
98-
[neovim-remote](https://github.com/mhinz/neovim-remote) to reload the nvim
99-
sessions externally.
72+
### bash/zsh aliases
10073
101-
Install neovim-remote:
74+
Add this in your `.zshrc` or `.bashrc` file:
10275
10376
```bash
104-
pip install --user neovim-remote
105-
```
106-
107-
Reload a neovim session using:
77+
LIGHT_COLOR='base16-gruvbox-light-soft.yml'
78+
DARK_COLOR='base16-gruvbox-dark-soft.yml'
10879
109-
```bash
110-
nvr -cc "source ~/.config/nvim/init.vim"
80+
alias day="alacritty-colorscheme -V apply $LIGHT_COLOR && reload_nvim"
81+
alias night="alacritty-colorscheme -V apply $DARK_COLOR && reload_nvim"
82+
alias toggle="alacritty-colorscheme -V toggle $LIGHT_COLOR $DARK_COLOR && reload_nvim"
11183
```
11284
113-
## Example bash/zsh configuration (base16-vim + neovim + neovim-remote)
85+
### i3wm/sway bindings
11486
115-
You can add this example configuration in your .zshrc or .bashrc to switch
116-
between dark and light theme.
117-
This snippet creates two aliases namely: `day`, `night`
87+
Add this in your i3 `config` file:
11888
11989
```bash
120-
function reload_nvim {
121-
for SERVER in $(nvr --serverlist); do
122-
nvr -cc "source ~/.config/nvim/init.vim" --servername $SERVER &
123-
done
124-
}
90+
set $light_color base16-gruvbox-light-soft.yml
91+
set $dark_color base16-gruvbox-dark-soft.yml
12592
126-
COLOR_DIR="$HOME/.aaron-williamson-alacritty-theme/colors"
127-
LIGHT_COLOR='base16-gruvbox-light-soft.yml'
128-
DARK_COLOR='base16-gruvbox-dark-soft.yml'
93+
# Toggle between light and dark colorschemes
94+
bindsym $mod+Shift+n exec alacritty-colorscheme -V toggle $light_color $dark_color
95+
96+
# Toggle between all available colorschemes
97+
bindsym $mod+Shift+m exec alacritty-colorscheme -V toggle
12998
130-
alias day="alacritty-colorscheme -C $COLOR_DIR -a $LIGHT_COLOR -V && reload_nvim"
131-
alias night="alacritty-colorscheme -C $COLOR_DIR -a $DARK_COLOR -V && reload_nvim"
99+
# Get notification with current colorscheme
100+
bindsym $mod+Shift+b exec notify-send "Alacritty Colorscheme" `alacritty-colorscheme status`
132101
```
133102
134-
## Example i3wm/sway configuration
103+
## Development
104+
105+
### Running locally
135106
136107
```bash
137-
set $color_dir $HOME/.aaron-williamson-alacritty-theme/colors
138-
set $light_color base16-gruvbox-light-soft.yml
139-
set $dark_color base16-gruvbox-dark-soft.yml
108+
pip install --user poetry
109+
110+
git clone https://github.com/toggle-corp/alacritty-colorscheme.git
111+
cd alacritty-colorscheme
140112
141-
# Toggle between light and dark colorscheme
142-
bindsym $mod+Shift+n exec alacritty-colorscheme -C $color_dir -t $light_color $dark_color
113+
poetry install
114+
poetry run python -m alacritty_colorscheme.cli
115+
```
143116
144-
# Toggle between all available colorscheme
145-
bindsym $mod+Shift+m exec alacritty-colorscheme -C $color_dir -T
117+
### Installing locally
146118
147-
# Get notification with current colorscheme
148-
bindsym $mod+Shift+b exec notify-send "Alacritty Colorscheme" `alacritty-colorscheme -C $color_dir -s`
119+
```bash
120+
pip install --user .
149121
```
150122
151123
## License

alacritty_colorscheme/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.2.0'
1+
__version__ = '0.2.1'

0 commit comments

Comments
 (0)