From 39029235d7514962c08d7353a20cab537c94b8cf Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 28 Mar 2020 21:55:00 +0000 Subject: [PATCH] Remove script from colorschemes --- Color-schemes.md | 70 ------------------------------------------------ 1 file changed, 70 deletions(-) diff --git a/Color-schemes.md b/Color-schemes.md index 3ff6b5f..226c50e 100644 --- a/Color-schemes.md +++ b/Color-schemes.md @@ -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`. -
-Here's how to use a script to render this page to such a scheme registry and then run a "slideshow" of the themes. - -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. -
- - ## [Afterglow](https://github.com/YabataDesign/afterglow-theme) ```yaml