Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Solarized themes (dark and light) for #roxterm.

Roxterm solarized theme

Description

Solarized themes (dark and light) for roxterm.

Install

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

Issue tracking

This repo does not have a separate issue tracking system. Please report issue to solatarized 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. Improvenments are always welcome, though.)

I preferred that you fork/clone this repo and send me a pull request (opening up an issue and mention 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
@booiiing
Copy link

booiiing commented Apr 19, 2011

Thank you for the great script!

@Leonidas-from-XIV
Copy link

Leonidas-from-XIV commented Sep 13, 2011

Shouldn't the files be called solarized instead of solartized? ;) Nevertheless, very handy, I don't have to write the configuration myself. I'd love this to be part of ROXterm itself.

@weakish
Copy link
Author

weakish commented Sep 17, 2011

@ Leonidas-from-XIV Thanks for pointing out my typo. Fixed.

@rpdillon
Copy link

rpdillon commented Jan 23, 2013

Nice job! Thanks for this.

@gbishop
Copy link

gbishop commented Jun 20, 2014

I think a couple of colors may be swapped in the light script. I think they should be like this:

0=#00002b2b3636
1=#dcdc32322f2f
2=#858599990000
3=#b5b589890000
4=#26268b8bd2d2
5=#d3d336368282
6=#2a2aa1a19898
7=#eeeee8e8d5d5
8=#070736364242
9=#cbcb4b4b1616
10=#9393a1a1a1a1
11=#838394949696
12=#65657b7b8383
13=#6c6c7171c4c4
14=#58586e6e7575
15=#fdfdf6f6e3e3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment