You are not logged in.
Updates:
update to st revision 71328cbcdc88f4fdfbb62d8c0324938e245c8971
moved patches to the suckless st wiki page
urxvt now works, too.
Hi there!
For a long time, i tried to get the exact solarized colors in my terminal. Unfortunately, most of the time, either the terminal was not presenting the colors right, or if so, they would break in vim or in vim inside tmux. Now i got all of them right -- for urxvt, that is true at least for the current version shipped by arch linux.
The author of solarized strongly suggests to replace the 16 ANSI terminal colors with the solarized ones to get the right results, and thats exactly what we are going to do here.
To check for the right colors, i used the simpler-script and kcolorchooser to verify the colors manually. No matter what terminal you use, make sure that the colors for normal and bold look the same:
While i still can't get the right colors in urxvt on ubuntu 12.04, i now have a working configuration on Arch with rxvt-unicode 9.18. To get it right, you need to add
URxvt.intensityStyles: false
to your ~/.Xresources, along with the solarized colors.
I keep up with upstream for my patches (there is no change at all most of the time), but after a new stable release is out, i will only release patches for the stable releases.
$ mkdir ~/st-solarized
$ cd ~/st-solarized
$ git clone http://git.suckless.org/st
$ cd st
Patches are now at the st wiki.
$ git apply st-no-bold-colors.diff
$ cp config.def.h config.h
$ git add config.h
Before you configure your favorite font, fontsize etc. in config.h, apply one of these two patches to get the solarized colors in st:
For the dark variant of solarized:
$ git apply st-solarized-dark.diff
Or, if you like the light version more:
$ git apply st-solarized-light.diff
Note: If you are on openbsd, have a look at this patch as well.
$ make clean
$ make
$ sudo make install
$ st
Alright, the solarized colors show up nicely in st now. But vim needs to be adjusted as well.
See https://github.com/tpope/vim-pathogen:
$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ git clone https://github.com/tpope/vim-pathogen.git
and link the pathogen.vim to ~/.vim/autoload/pathogen.vim.
See https://github.com/altercation/solarize … -solarized:
$ cd ~/.vim/bundle
$ git clone git://github.com/altercation/vim-colors-solarized.git
To use the right colors in vim, you need to enable pathogen and the solarized colors in your .vimrc:
set nocompatible
set t_Co=16
call pathogen#infect()
syntax on
set background=dark " dark | light "
colorscheme solarized
filetype plugin on
If you want to highlight the current line and column 80 as well, add
set cursorline
set colorcolumn=80
To toggle the color scheme between dark and light with F5, you can add
call togglebg#map("<F5>")
Now, vim should display the right colors as well.
With standard settings, tmux uses colors for its decorations (status-bar, pane-indexes etc.) that do not match the solarized-look. Here are the changes i made by adding this to my ~/.tmux.conf, feel free to adjust:
# --- colors (solarized dark)
# default statusbar colors
set -g status-bg black
set -g status-fg yellow
set -g status-attr default
# default window title colors
setw -g window-status-fg brightblue
setw -g window-status-bg default
# active window title colors
setw -g window-status-current-fg yellow
setw -g window-status-current-bg default
setw -g window-status-current-attr dim
# pane border
set -g pane-border-fg black
set -g pane-border-bg default
set -g pane-active-border-fg yellow
set -g pane-active-border-bg default
# command line/message text
set -g message-bg black
set -g message-fg yellow
# pane number display
set -g display-panes-active-colour yellow
set -g display-panes-colour brightblue
# clock
setw -g clock-mode-colour yellow
# --- end colors
Last edited by drm00 (2014-03-25 18:37:46)
Offline
The TERMINFO hack seems unnecessary. Instead you could just set st's TERM to xterm-256color, which worked for me.
For example, in config.h change:
static char termname[] = "st";
to:
static char termname[] = "xterm-256color";
EDIT: config.h example
Last edited by thirtypancakes (2013-05-28 05:51:06)
Offline
If I have to remove the oversized image a third time, I'll just delete the thread instead:
-- mod edit: read the rules and only post thumbnails https://bbs.archlinux.org/viewtopic.php?id=61754 [jwr] --
Offline
If I have to remove the oversized image a third time, I'll just delete the thread instead:
-- mod edit: read the rules and only post thumbnails https://bbs.archlinux.org/viewtopic.php?id=61754 [jwr] --
Sorry for the trouble, but i didn't had these problems. After your first advise, I embedded the small preview image from imgur and checked with firefox and chrome, and for me the size was alright. But i guess i just leave it like this for now.
Offline
The TERMINFO hack seems unnecessary. Instead you could just set st's TERM to xterm-256color, which worked for me.
For example, in config.h change:
static char termname[] = "st";
to:
static char termname[] = "xterm-256color";
EDIT: config.h example
Hi,
thanks for your reply. Did you check with vim inside tmux? That used to break the colors when i wasn't using a 16 color xterm; in fact, all 256-color-terminals broke the colors for me, even if the values were close, they never had the exact right values. I am at work right now, but will try out later when i'm at home.
Best,
drm00
Offline
thirtypancakes wrote:The TERMINFO hack seems unnecessary. Instead you could just set st's TERM to xterm-256color, which worked for me.
For example, in config.h change:
static char termname[] = "st";
to:
static char termname[] = "xterm-256color";
EDIT: config.h example
Hi,
thanks for your reply. Did you check with vim inside tmux? That used to break the colors when i wasn't using a 16 color xterm; in fact, all 256-color-terminals broke the colors for me, even if the values were close, they never had the exact right values. I am at work right now, but will try out later when i'm at home.
Best,
drm00
I'm not sure the colors in vim are absolutely correct, but I'll attach a screenshot so you can judge for yourself.
Here's a screenshot comparing vim in tmux/st and vim in plain st.
Offline
Ok, I tried it now with xterm-256color, but i dont think we have to change the termname at all, because i got the same results with st-256color. Will adjust the patches/post tomorrow, thanks for your feedback!
Offline
No worries. Thanks for the awesome patches!
Offline
Updated post, urxvt now works, too (at least on arch); new patches and screenshots.
Offline
First off, thanks for the excellent info! Secondly, maybe I'm missing something but your st patches linked in your first post don't seem to work. All three of them just load a blank prompt on hastebin...
Offline
Hi jonyamo, thanks for the hint. Seems that hastebin takes its name too seriously, so i uploaded all patches to github.
Offline
Update to st revision 587bc939f63b49c6155c4f1fdf97e73380207446.
Offline
Any idea how to change the colors of the startup and login shell to solarized? I read something about passing parameters to the kernel on boot but I couldn't figure out how it's done. After that it's just a matter a grub theme and you'll never have a black background
Offline
Offline
hello,
thanks for the patches and the detailed instructions.
I still have to use xterm (for which solarized works very well), because, for some reason, I can't get st to load *adobe source code pro*. Would you mind sharing your config.h for st as well??
Offline
Hi Cercasi,
for the font, i have
static char font[] = "Source Code Pro Medium-18:style=Regular";
Besides the solarized patch, this is the only change i made to my config.h.
Offline
thanks!
Your suggestions works well. My problem was that I use a rather small font and "source code pro" doesn't seem to produce nice results for that. Therefore, I settled with
static char font[] = "Bitstream Vera Sans Mono-9:pixelsize=10.754";
Offline
@drm00
Thanks for your provided guidelines. I am currently using your colours with Urxvt. However, I discovered that the grey colour is hard to read.
Example from htop: http://i.imgur.com/d9LekJu.png
What colour change would you advise to make grey more readable?
Last edited by orschiro (2014-05-11 07:44:04)
Offline
@drm00
Thanks for your provided guidelines. I am currently using your colours with Urxvt. However, I discovered that the grey colour is hard to read.
Example from htop: http://i.imgur.com/d9LekJu.png
What colour change would you advise to make grey more readable?
@orschiro try htop-solarized patch.
Offline
@serdotlinecho
Thanks for the package link! Does that mean that this is an application issue rather than a shortcoming of the colours declared in .Xresources?
In fact, I am noticing the same issue with pachist-git:
Offline
@serdotlinecho
Thanks for the package link! Does that mean that this is an application issue rather than a shortcoming of the colours declared in .Xresources?
In fact, I am noticing the same issue with pachist-git:
The easiest would probably be to just change the color in /bin/pachist. It Just bash so open it as root with your text editor and change 'col_1="black" ' to something else.
Offline
Can someone help me finding the exact hex code for the default font colour? I thought it was #839496 but this does not give me an exact fit:
Last edited by orschiro (2014-05-14 21:47:36)
Offline
@drm00:
Thanks for the guide + diffs.
1. The diffs don't seem to work for the latest st (0.5)
2. In your steps, in the section "Create your config.h and adjust the solarized colors":
--- you have this first:
$ cp config.def.h config.h
$ git add config.h
...but really I believe you want to apply the diff patches first, as the diff patches apply to config.def.h.
Offline
Small problem when running vim:
CSApprox skipped; terminal only has 16 colors, not 88/256
Try checking :help csapprox-terminal for workarounds
Press ENTER or type command to continue
Any way I can get rid of the error?
Offline