Topic: miniHOWTO: Solarize your terminal emulator and editor!

Knowing absolutely nothing about X colors, I came across this very Applesque advertisement for recoloring your text environments, http://ethanschoonover.com/solarized, and decided to give it a shot.

Terminal emulator: For using the colors in rxvt-unicode and the like, all you have to do is copy https://github.com/altercation/solarize … Xresources and paste it into a file called ~/.Xresources, which won't exist unless you make it. Alternatively, download this file, decompress it, and rename it as your ~/.Xresources. Then (re)load this file:

xrdb -merge ~/.Xresources

and you're ready to go.

Editor: I use Emacs. The files for Emacs live in https://github.com/sellout/emacs-color-theme-solarized and can be downloaded as a tarball here https://github.com/sellout/emacs-color- … all/master.

But first be sure you have color-theme mode in your Emacs. You can get it from the Debian and Ubuntu repo's in emacs-goodies-el which you should always install with Emacs anyway.

Now decompress the tarball linked to above, and copy the files to your ~/.emacs.d folder

cd ~/Downloads/
tar -xvzf sellout-emacs-color-theme-solarized-cfa6d87.tar.gz
cd sellout-emacs-color-theme-solarized-cfa6d87
cp * ~/.emacs.d

Now configure your ~/.emacs to load color-theme and the new colors.

(add-to-list 'load-path "~/.emacs.d/") ; tells Emacs to load files in this directory
(require 'color-theme) ; tells Emacs to always enable color-theme mode
    (color-theme-initialize) ; not necessary for the Solarized colors, but this tells Emacs to load all the color-themes at startup so that you can immediately switch between them if you wish
(require 'color-theme-solarized) ; tells Emacs to enable Solarized colors

Lastly, to load the colors, do

M-x color-theme-solarized

and pick light or dark. What's great here is that 1) like all Emacs colors, they're a minor-mode, so you can load them interactively; 2) according to their author, they're the inverse of each other so you retain some consistency between light and dark setups, which I strongly recommend you switch between according to lighting conditions.

Last edited by dmhdlr (2011-11-16 21:34:29)

"Emacs: making you posthuman since 1976"
Axiom #1: Emacs is a text interface prosthesis
Axiom #2: Org-mode gives you super cyborg organizational powers
cf. Why Emacs | Emacs-fu | EmacsWiki | Worg

Re: miniHOWTO: Solarize your terminal emulator and editor!

Oh, that's actually very clever. I have often thought about such a one-size-fits-all color scheme, but I've never cared enough to do the science. Thanks for the link. By the way... <troll>Emacs is cool, what text editor do you use?</troll>

I'm so meta, even this acronym

Re: miniHOWTO: Solarize your terminal emulator and editor!

I did this about a week ago and it works like a charm in emacs and I like this color scheme.Terminator ignored it though. Could it be because I included the color scheme in .Xdefaults rather than .Xresources?

I have also implemented Solarized manually in slrn. It works fine but I am still considering re-shuffling some of my choices.

Added note: After having read this:
http://hivelogic.com/articles/top-10-programming-fonts/
the other day I played around with font choices but came back to Terminus. It seems the fancier, hinted fonts don't work well with a low-contrast color scheme.

/Martin

Last edited by MartinRF (2011-11-16 23:36:46)

Re: miniHOWTO: Solarize your terminal emulator and editor!

MartinRF wrote:

I did this about a week ago and it works like a charm in emacs and I like this color scheme.Terminator ignored it though. Could it be because I included the color scheme in .Xdefaults rather than .Xresources?

I have also implemented Solarized manually in slrn. It works fine but I am still considering re-shuffling some of my choices.

Terminator has its own GUI dialog for choosing colors and doesn't read Xresources.

Re: miniHOWTO: Solarize your terminal emulator and editor!

MartinRF wrote:

I did this about a week ago and it works like a charm in emacs and I like this color scheme.Terminator ignored it though. Could it be because I included the color scheme in .Xdefaults rather than .Xresources?

I have also implemented Solarized manually in slrn. It works fine but I am still considering re-shuffling some of my choices.

Added note: After having read this:
http://hivelogic.com/articles/top-10-programming-fonts/
the other day I played around with font choices but came back to Terminus. It seems the fancier, hinted fonts don't work well with a low-contrast color scheme.

/Martin

There's some good bitmaps here: http://vim.wikia.com/wiki/The_perfect_programming_font

Neep is available in the Debian repo's. I'm currently using Gohu http://font.gohu.eu/. Turns out it hails from Archland. https://bbs.archlinux.org/viewtopic.php?id=89049

Last edited by dmhdlr (2011-11-16 23:53:03)

"Emacs: making you posthuman since 1976"
Axiom #1: Emacs is a text interface prosthesis
Axiom #2: Org-mode gives you super cyborg organizational powers
cf. Why Emacs | Emacs-fu | EmacsWiki | Worg

Re: miniHOWTO: Solarize your terminal emulator and editor!

That "gohu" is a good find.

especially at 14px it's really hawt

Last edited by rstrcogburn (2011-11-16 23:56:35)

Well, you gotta live no matter what happens.  -Dallas (John Ford's Stagecoach 1939 Public Domain)

Re: miniHOWTO: Solarize your terminal emulator and editor!

Loaded it up, it's not bad, but I just can't break away from Fixed. It's the most complete one (terminus would take the spot if it had a bold variety).

Re: miniHOWTO: Solarize your terminal emulator and editor!

I've been using Solarized for quite a while now (clicky!) - love it! I use the vim colour scheme too, and have mapped F12 to switch between the light and dark versions.

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: miniHOWTO: Solarize your terminal emulator and editor!

Yeah I've been using it for a while with gvim, just recently got it with Xresources (somehow it wasn't working for me earlier...whatever it does now tongue ) & I used the dark/light selector patch though, to make it all the easier smile .

safetycopy, I never thought to map a key to it--now I'll have to! I'll have to try some way with urxvt too cool

ps. re the Terminator issue: that's actually why I quit using it - I like text files smile

Leave the gun. Take the cannoli.

Re: miniHOWTO: Solarize your terminal emulator and editor!

hey nice, i never really took the time to figure out how to add colors to emacs. i see people raving about emacs here and there and all i think is 'i do not really care about all the cool shortcuts, when the app is butt-ugly' smile

Re: miniHOWTO: Solarize your terminal emulator and editor!

mahatman2 wrote:

safetycopy, I never thought to map a key to it--now I'll have to!

I have this in my .vimrc:

map <silent> <F12> :if background == "light" <CR>
\set background=dark<CR>
\else<CR>
\set background=light<CR>
\endif<CR>
"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: miniHOWTO: Solarize your terminal emulator and editor!

rstrcogburn wrote:

That "gohu" is a good find.

especially at 14px it's really hawt

How do you install gohu? It comes in either bdf or pcf formats. I have tried to read up on this but only got confused.

/Martin

Re: miniHOWTO: Solarize your terminal emulator and editor!

MartinRF wrote:
rstrcogburn wrote:

That "gohu" is a good find.

especially at 14px it's really hawt

How do you install gohu? It comes in either bdf or pcf formats. I have tried to read up on this but only got confused.

/Martin

replicant did a nice writeup, bottom of thread: http://crunchbanglinux.org/forums/topic … hy-bitmap/

Edit, first things first. Run

sudo dpkg-reconfigure fontconfig-config

Answer Yes to the third question. Then

sudo dpkg-reconfigure fontconfig

To make sure the system reads bitmaps.

Last edited by el_koraco (2011-11-17 21:38:35)

Re: miniHOWTO: Solarize your terminal emulator and editor!

You would have to do that on Ubuntu correct?

"Emacs: making you posthuman since 1976"
Axiom #1: Emacs is a text interface prosthesis
Axiom #2: Org-mode gives you super cyborg organizational powers
cf. Why Emacs | Emacs-fu | EmacsWiki | Worg

Re: miniHOWTO: Solarize your terminal emulator and editor!

AFAIK, Ubuntu doesn't have fontconfig-config. You have to symlink or delete something, not sure what.

Re: miniHOWTO: Solarize your terminal emulator and editor!

safetycopy wrote:
mahatman2 wrote:

safetycopy, I never thought to map a key to it--now I'll have to!

I have this in my .vimrc:

map <silent> <F12> :if background == "light" <CR>
\set background=dark<CR>
\else<CR>
\set background=light<CR>
\endif<CR>

hey this didn't work for me... hmm I put it in just like it is here. I wonder what the matter is.

Leave the gun. Take the cannoli.

Re: miniHOWTO: Solarize your terminal emulator and editor!

el_koraco wrote:

That "gohu" is a good find.
replicant did a nice writeup, bottom of thread: http://crunchbanglinux.org/forums/topic … hy-bitmap/

Edit, first things first. Run

sudo dpkg-reconfigure fontconfig-config

Answer Yes to the third question. Then

sudo dpkg-reconfigure fontconfig

To make sure the system reads bitmaps.

Thanks. I am trying out gohu right now. 10 pt is a little on the small side for my old eyes and 14 pt is on the big side for my screen's resolution but it is a very nice one anyways.

/Martin

Re: miniHOWTO: Solarize your terminal emulator and editor!

Would it work for lxterminal?  I pasted the contents into my ~/.Xresources, but I don't see any changes after saving the file.

! xscreensaver ---------------------------------------------------------------

!font settings
xscreensaver.Dialog.headingFont:        -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.bodyFont:           -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.labelFont:          -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.unameFont:          -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.buttonFont:         -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
xscreensaver.Dialog.dateFont:           -*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*
xscreensaver.passwd.passwdFont:         -*-fixed-medium-r-*-*-14-*-*-*-*-*-*-*
!general dialog box (affects main hostname, username, password text)
xscreensaver.Dialog.foreground:         #101010
xscreensaver.Dialog.background:         #D8D8D8
xscreensaver.Dialog.topShadowColor:     #D8D8D8
xscreensaver.Dialog.bottomShadowColor:  #D8D8D8
xscreensaver.Dialog.Button.foreground:  #101010
xscreensaver.Dialog.Button.background:  #E5E5E5
!username/password input box and date text colour
xscreensaver.Dialog.text.foreground:    #101010
xscreensaver.Dialog.text.background:    #E5E5E5
xscreensaver.Dialog.internalBorderWidth:24
xscreensaver.Dialog.borderWidth:        20
xscreensaver.Dialog.shadowThickness:    2
!timeout bar (background is actually determined by Dialog.text.background)
xscreensaver.passwd.thermometer.foreground:  #101010
xscreensaver.passwd.thermometer.background:  #2E2E2E
xscreensaver.passwd.thermometer.width:       8

!! drop in Solarized colorscheme for Xresources/Xdefaults

!!SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
!!--------- ------- ---- ------- ----------- ---------- ----------- -----------
!!base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
!!base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
!!base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
!!base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
!!base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
!!base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
!!base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93
!!base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
!!yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71
!!orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80
!!red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86
!!magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83
!!violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77
!!blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
!!cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
!!green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60

#define S_base03 #002b36
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
#define S_yellow #b58900
#define S_orange #cb4b16
#define S_red #dc322f
#define S_magenta #d33682
#define S_violet #6c71c4
#define S_blue #268bd2
#define S_cyan #2aa198
#define S_green #859900

*background: S_base03
*foreground: S_base00
*fading: 40
*fadeColor: S_base03
*cursorColor: S_base1
*pointerColorBackground:S_base01
*pointerColorForeground:S_base1

!! black dark/light
*color0: S_base02
*color8: S_base03

!! red dark/light
*color1: S_red
*color9: S_orange

!! green dark/light
*color2: S_green
*color10: S_base01

!! yellow dark/light
*color3: S_yellow
*color11: S_base00

!! blue dark/light
*color4: S_blue
*color12: S_base0

!! magenta dark/light
*color5: S_magenta
*color13: S_violet

!! cyan dark/light
*color6: S_cyan
*color14: S_base1

!! white dark/light
*color7: S_base2
*color15: S_base3

Re: miniHOWTO: Solarize your terminal emulator and editor!

mahatman2 wrote:
safetycopy wrote:
mahatman2 wrote:

safetycopy, I never thought to map a key to it--now I'll have to!

I have this in my .vimrc:

map <silent> <F12> :if background == "light" <CR>
\set background=dark<CR>
\else<CR>
\set background=light<CR>
\endif<CR>

hey this didn't work for me... hmm I put it in just like it is here. I wonder what the matter is.

Post your .vimrc - maybe we can spot the problem.

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: miniHOWTO: Solarize your terminal emulator and editor!

sunfizz98 wrote:

Would it work for lxterminal?  I pasted the contents into my ~/.Xresources, but I don't see any changes after saving the file.

Does LXTerminal normally read from .Xresources?

"Emacs: making you posthuman since 1976"
Axiom #1: Emacs is a text interface prosthesis
Axiom #2: Org-mode gives you super cyborg organizational powers
cf. Why Emacs | Emacs-fu | EmacsWiki | Worg

Re: miniHOWTO: Solarize your terminal emulator and editor!

@safetycopy : here it is smile thanks for your concern!

Leave the gun. Take the cannoli.

Re: miniHOWTO: Solarize your terminal emulator and editor!

^ Don't see anything that could be conflicting. I've posted my .vimrc so maybe you can copy and paste from that and see if it works then?

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: miniHOWTO: Solarize your terminal emulator and editor!

@safetycopy : I must have had a typo in my other file. This works great, thanks! smile

Leave the gun. Take the cannoli.

Re: miniHOWTO: Solarize your terminal emulator and editor!

No probs smile

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.

Re: miniHOWTO: Solarize your terminal emulator and editor!

Just realised something...

I've been using this:

map <silent> <F12> :if background == "light" <CR>
\set background=dark<CR>
\else<CR>
\set background=light<CR>
\endif<CR>

...in my ~/.vimrc to switch between Solarized's dark and light backgrounds, but Solarized actually includes a plugin to do this already roll All you actually need is:

call togglebg#map("<F5>")

Just replace <F5> with whichever function key you want to use.

"Stranger, if you passing meet me and desire to speak to me, why should you not speak to me? And why should I not speak to you?" Walt Whitman, 'To You'.