Skip to content

Instantly share code, notes, and snippets.

@dampdigits
Forked from weakish/README.markdown
Last active December 8, 2023 21:08
Show Gist options
  • Save dampdigits/a1fbcf15c46dbe639f69930038ca43d3 to your computer and use it in GitHub Desktop.
Save dampdigits/a1fbcf15c46dbe639f69930038ca43d3 to your computer and use it in GitHub Desktop.
#Solarized themes (dark and light) for #roxterm.

Roxterm solarized theme

Description

Solarized themes (dark and light) for roxterm.

Install

Copy solarized-dark and/or solarized-light into ~/.config/roxterm.sourceforge.net/Colours/.

Issue tracking

This repo does not have a separate issue tracking system. Please report issue to solarized main repo. (You may mention me '@weakish' when reporting an issue.)

Please don't use the comment form of this gist for issues/bugs/suggests and pull requests. (Using it for other general feedback is fine, though.)

Development

For ease of updating and to avoid manual typos, I wrote a srcipt (gen-theme.rc) to generate the dark theme file from upstream (main solarized repo) README.md automatically. Then I copied the dark theme file and edited it manually to produce the light theme file. (Since there are only few differences, I don't bother to alter my script to generate both themes. Improvements are always welcome, though.)

I prefer that you fork/clone this repo and send me a pull request (by opening up an issue and mentioning me '@weakish').

Alternatively, you can post your patch in the issue system directly.

Links

#!/usr/bin/env rc
# by Jakukyo Friel <weakish@gmail.com> under GPL v2.
# Generate Solarized dark theme for roxterm.
# Works with both plan9 rc (plan9 unix port)
# and Byron Rakitzis' reimplementation.
# Tested with GNU grep/sed.
#
# Usage:
# Run it under the root of the solarized main repo.
# (At least make sure solarized README.md is under the current dir.)
#
# solarized% /path/to/gen_theme.rc > solarized-dark
#
# If you'd like to generate a light theme, alter the value of
# foreground, background and cursor (directly edit this script
# or edit the theme file afterwards).
fn gen_color_values {
cat README.md |
# extract the table
sed -n '/ SOLARIZED HEX/,/Usage & Development/p' |
sed -n '/ base03/,/ green/p' |
# extract required fields
grep -oE '^ [a-z0-9]+[ ]+#[0-9a-f]{6}[ ]+[0-9]{1,2}/'
}
# #abcdef -> #aabbccddeeff
fn convert_hex {
sed -r 's/#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/#\1\1\2\2\3\3/'
}
fn extract_color_value {
gen_color_values |
# Use $1^' ' to distinguish among base0/base01/base02/base03, etc.
grep $1^' ' | grep -oE '#[^ ]+' | convert_hex
}
fn gen_header {
echo '[roxterm colour scheme]'
echo 'foreground='^`{extract_color_value base0}
echo 'background='^`{extract_color_value base03}
}
fn gen_colormap {
gen_color_values |
grep -oE '#[^/]+' |
# sort from 0 to 15
sort -nk 2 |
# '#073642 0' -> '0=#070736364242'
sed -r 's/(#[^ ]+)[ ]+([0-9]{1,2})/\2=\1/' | convert_hex
}
fn gen_footer {
# Default colors specified by roxterm.
cat <<END
16=#4c4c4c4c4c4c
17=#a8a830303030
18=#202088882020
19=#a8a888880000
20=#555555559898
21=#888830308888
22=#303088888888
23=#d8d8d8d8d8d8
END
echo 'cursor='^`{extract_color_value base1}
echo 'palette_size=16'
}
# main
gen_header && gen_colormap && gen_footer
[roxterm colour scheme]
foreground=#838394949696
background=#00002b2b3636
0=#070736364242
1=#dcdc32322f2f
2=#858599990000
3=#b5b589890000
4=#26268b8bd2d2
5=#d3d336368282
6=#2a2aa1a19898
7=#eeeee8e8d5d5
8=#00002b2b3636
9=#cbcb4b4b1616
10=#58586e6e7575
11=#65657b7b8383
12=#838394949696
13=#6c6c7171c4c4
14=#9393a1a1a1a1
15=#fdfdf6f6e3e3
16=#4c4c4c4c4c4c
17=#a8a830303030
18=#202088882020
19=#a8a888880000
20=#555555559898
21=#888830308888
22=#303088888888
23=#d8d8d8d8d8d8
cursor=#9393a1a1a1a1
palette_size=16
[roxterm colour scheme]
foreground=#65657b7b8383
background=#fdfdf6f6e3e3
0=#070736364242
1=#dcdc32322f2f
2=#858599990000
3=#b5b589890000
4=#26268b8bd2d2
5=#d3d336368282
6=#2a2aa1a19898
7=#eeeee8e8d5d5
8=#00002b2b3636
9=#cbcb4b4b1616
10=#58586e6e7575
11=#65657b7b8383
12=#838394949696
13=#6c6c7171c4c4
14=#9393a1a1a1a1
15=#fdfdf6f6e3e3
16=#4c4c4c4c4c4c
17=#a8a830303030
18=#202088882020
19=#a8a888880000
20=#555555559898
21=#888830308888
22=#303088888888
23=#d8d8d8d8d8d8
cursor=#58586e6e7575
palette_size=16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment