iterm stuff added to tree (and trackable)

This commit is contained in:
Howland Owl 2017-04-25 18:42:51 +03:00
parent 705d6d4dc9
commit 1e0d8bdc07
1599 changed files with 99751 additions and 0 deletions

16
iterm2colors/tools/iterm2xrdb Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# Usage: iterm2xrdb FILE...
# Usage: cat FILE... | iterm2xrdb
# Usage: iterm2xrdb < INPUT
#
# Converts iTerm2 color schemes into xrdb(1) format, as a set of `#define`s,
# and prints the result to STDOUT. Reads STDIN if no input files are given.
#
# Written in 2013 by Suraj N. Kurapati <https://github.com/sunaku>
puts ARGF.read.scan(%r{>(.+?)</}).flatten(1).slice_before(/\bColor$/).map {
|color, *pairs| "#define #{ color.gsub(/\W/, ?_) } #" + Hash[*pairs].
values_at('Red Component', 'Green Component', 'Blue Component').
map { |intensity| sprintf '%02x', (intensity.to_f * 255).round }.join
}.to_a