-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu-change-colours
executable file
·45 lines (35 loc) · 1.21 KB
/
menu-change-colours
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/sh
## Menu
colour_list="dracula
nord
solarized-dark
solarized-light"
colourscheme=`echo "$colour_list" | $1 "Change colourscheme to: "`
## Filepaths
alacritty_base="$HOME/.config/alacritty/base.yml"
alacritty_themes_dir="$HOME/.config/alacritty/themes"
alacritty_config="$HOME/.config/alacritty/alacritty.yml"
nvim_colours_file="$HOME/.config/nvim/colours.vim"
## Change colours
change_alacritty() {
alacritty_colours="${alacritty_themes_dir}/${1}.yml"
[ -f $alacritty_base ] && [ -f $alacritty_colours ] \
&& echo "## DO NOT EDIT! This file is automatically generated from base.yml" > $alacritty_config \
&& cat $alacritty_base $alacritty_colours >> $alacritty_config
}
change_nvim() {
add_line() {
[ -f $nvim_colours_file ] \
&& echo $1 > $nvim_colours_file
}
case $1 in
dracula) add_line "colorscheme dracula" ;;
nord) add_line "colorscheme nord" ;;
solarized-dark) add_line "colorscheme NeoSolarized\nset background=dark" ;;
solarized-light) add_line "colorscheme NeoSolarized\nset background=light" ;;
esac
}
set_colours() {
change_alacritty
change_nvim
}