Remove script from colorschemes
parent
2d5decf66d
commit
39029235d7
|
@ -28,76 +28,6 @@ colors: *light
|
||||||
|
|
||||||
With this config, Alacritty will use Solarized Light. To switch to the dark version, change `colors: *light` to `colors: *dark`.
|
With this config, Alacritty will use Solarized Light. To switch to the dark version, change `colors: *light` to `colors: *dark`.
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Here's how to use a script to render this page to such a scheme registry and then run a "slideshow" of the themes.</summary>
|
|
||||||
|
|
||||||
Feed [the markdown source of the page](Color-schemes.md) to the following Ruby script:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
#!/usr/bin/env ruby
|
|
||||||
|
|
||||||
require 'yaml'
|
|
||||||
|
|
||||||
alcs0 = $<.each_with_object({y:false, t:[]}) { |l,ah|
|
|
||||||
l=~/\A## (?:\[([^\]]+)\]|(.*))/ and (ah[:t] << [$1||$2]; next)
|
|
||||||
l.strip=="```yaml" and (ah[:y]=true; next)
|
|
||||||
ah[:y] and l.strip=="```" and (ah[:y]=false;next)
|
|
||||||
ah[:y] and (ah[:t].last||[]) << l
|
|
||||||
}[:t]
|
|
||||||
alcs1 = alcs0.each_with_object({}) { |e,ah|
|
|
||||||
(e[1..-1].grep(/\A\s*[^#]/)[0]||"") =~ /colors:/ and ah[e[0]]=YAML.load(e[1..-1].join)["colors"]
|
|
||||||
}
|
|
||||||
alcs2 = {"schemes"=> alcs1, "scheme_toc"=> alcs1.dup}
|
|
||||||
|
|
||||||
puts alcs2.to_yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
That gives you something like:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
schemes:
|
|
||||||
Afterglow: &1
|
|
||||||
primary:
|
|
||||||
background: "#2c2c2c"
|
|
||||||
foreground: "#d6d6d6"
|
|
||||||
# ...
|
|
||||||
scheme_toc:
|
|
||||||
Afterglow: *1
|
|
||||||
Argonaut: *2
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can add your choice by hand:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
colors: *2
|
|
||||||
```
|
|
||||||
Or, saving the output as _alcs.yml_, you can run a "slideshow" of themes as follows:
|
|
||||||
|
|
||||||
- Invoke the terminal as `alacritty --config-file=alcs.yml`
|
|
||||||
- Then invoke following script on _alcs.yml_:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
cnf="$1"
|
|
||||||
tty=`tty`
|
|
||||||
|
|
||||||
ruby -ryaml -e 'puts YAML.load($<)["schemes"].keys' "$cnf" | cat -n | \
|
|
||||||
while read j s; do
|
|
||||||
echo $j. $s
|
|
||||||
ruby -ryaml -i -e '
|
|
||||||
sch=$*.pop
|
|
||||||
cnf=YAML.load $<
|
|
||||||
cnf["colors"]=cnf["schemes"][sch]
|
|
||||||
puts cnf.to_yaml' "$cnf" "$s"
|
|
||||||
read < $tty
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
Step next by hitting enter.
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
## [Afterglow](https://github.com/YabataDesign/afterglow-theme)
|
## [Afterglow](https://github.com/YabataDesign/afterglow-theme)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
Loading…
Reference in New Issue