Hacker News new | past | comments | ask | show | jobs | submit login
4bit - Terminal Color Scheme Designer (ciembor.github.com)
147 points by ciembor on Aug 21, 2012 | hide | past | favorite | 33 comments



Hi all. I think I did something cool and I want to share it with you. Who loves Linux knows, that customizing things sometimes takes too much time. Customizing terminal color schemes is one of these things. I present you the 4bit - Terminal Color Scheme Designer, which allows you to create your own theme and generate .Xresources / .Xdefaults config in just few minutes:). Thanks for voting, digging, tweeting, liking or whatever - I really appreciate it! Enjoy. :)


I'd like to be able to drag the two thumbs on each "Lightness" slider past each other, to invert the usual relationship. (Just splitting them into two sliders each would be fine.) Otherwise, this is really great.


Great work! I just sent this off to my team so we can all enjoy a much friendlier color scheme :)

I wonder if most engineers find the terminal unpleasant to look at, or is it mostly the "artsy" engineers that are bothered by it...


Most editor/terminal color schemes are terrible, full stop. Color splashed everywhere without a thought.

Solarized is one of the few that looks decent, but I don't agree with the deep blue.


I have a virtual machine with no X11 and wanted to use the Solarized color scheme in my CLI programs, so I replaced the default 16 colors this way:

  (.bashrc)

  if [ "$TERM" = "linux" ]; then
      echo -en "\e]P0002b36"
      echo -en "\e]P1073642"
      echo -en "\e]P2586e75"
      echo -en "\e]P3657b83"
      echo -en "\e]P4839496"
      echo -en "\e]P593a1a1"
      echo -en "\e]P6eee8d5"
      echo -en "\e]P7fdf6e3"
      echo -en "\e]P8b58900"
      echo -en "\e]P9cb4b16"
      echo -en "\e]PAdc322f"
      echo -en "\e]PBd33682"
      echo -en "\e]PC6c71c4"
      echo -en "\e]PD268bd2"
      echo -en "\e]PE2aa198"
      echo -en "\e]PF859900"
      clear
  fi
I'm still shuffling them around, but it has worked pretty well. The nicest thing is that all my programs now support the color scheme.


This is just changing the palette of fbcon. Kernel parameters vt.default_{red,grn,blu}= do the same thing. I used to add this tango color scheme in grub:

    GRUB_CMDLINE_LINUX="vt.default_red=0,204,78,196,52,117,6,170,85,239,138,252,114,173,52,211 vt.default_grn=0,0,154,160,101,80,152,170,87,41,226,233,159,127,226,215 vt.default_blu=0,0,6,0,164,123,154,170,83,41,52,79,207,168,226,207"
Recently I found I could avoid polluting /proc/cmdline by changing the palette later in booting by setting it via sysfs in /etc/default/console-setup (or equivalent ones of your distros):

    echo 0,204,78,196,52,117,6,170,85,239,138,252,114,173,52,211 >/sys/module/vt/parameters/default_red
    echo 0,0,154,160,101,80,152,170,87,41,226,233,159,127,226,215 >/sys/module/vt/parameters/default_grn
    echo 0,0,6,0,164,123,154,170,83,41,52,79,207,168,226,207 >/sys/module/vt/parameters/default_blu
    echo -n '\033]R'


So, this is a really embarrassing question: is there a reliable guide for how to use these? I've been googling, (and DDGing and Ecosia-ing), but everything seems to be out of date. I don't have, for instance, a .Xresources file. At least not one that 'locate' can find.

Or do these commands go in .bashrc? or .vimrc? Thanks.


You just create a ~/.Xresources file and when you log into X11, the session should source that file.

You can also force-load it (into your current X11 session) with:

  xrdb -merge ~/.Xresources
or

  xrdb -load ~/.Xresources
It's also possible to put it in the ~/.Xdefaults file, though I'm not sure what the difference is.


.Xdefaults do the same thing, but it looks this file is deprecated. I may recomend the Arch Linux Wiki: https://wiki.archlinux.org/index.php/X_resources .


Thank you both.


Here's the source for that colors.sh script shown emulated in the demo:

http://code.google.com/p/iterm2/source/browse/trunk/tests/co...

Oddly, the author didn't include it in the 4bit Github repo. Run the script for yourself to compare against your current color scheme.


Good point! I was inspired by this topic on Arch Linux forum - https://bbs.archlinux.org/viewtopic.php?id=51818&p=1. There are more similar scripts.


That's a pretty cool site! On a related note: I wrote a little bash color reference script, which is a useful reference whenever you want to add a bit of color to your scripts: http://madebynathan.com/2011/08/15/bash-color-index/


While you're at it, consider switching to a 256-color terminal.


Changing the base 16 colors of a 256-color terminal is still useful. I started overhauling my colors a few weeks ago, and decided that the best approach is to colorize most things using the 16-color palette and adjusting that to look nice, rather than eg setting LS_COLORS to spit out high colors. This gets me immediate results for programs/hosts I haven't customized, and less degradation if I happen to be using a less capable terminal.


Indeed, they are complementary. The basic 16 colors can be configured globally by the terminal which is convenient. 256 colors has to be supported by the particular application but I mostly care about the vim scheme anyway. I have a scheme which uses multiple shades of gray so as not be as distracting as the typical syntax highlighting `salad.'


Makes me kind of sad that I got used to the Solarized color scheme already (I use it in VIM, iTerm, Visual Studio etc... ), so I have no use for customizing my color schemes any further. I'd love to use this :(


I don't get why people like Solarized. It's way too low contrast in every dimension for my particular flavour of colour blindness. Maybe it's just a particularly pessimal colour scheme for me :(

(Also the designer appears to have based one of the key colour choices on his memories of almost drowning to death as a child. http://www.metafilter.com/102504/Solarized#3636286)


Oh but I'm not color blind :)

Also solarized comes with various different "contrast versions" have you tried them all? By the way, what's your choice in color scheme being color blind and all?


I use the Gnome Tango colour scheme http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines where possible.

I find it has good contrast between colours in general. In particular I can actually read the blue it uses on a black background. Most of the colours have good contrast with each other even at extremely low saturation too.

For my vision there are some small tweaks I sometimes make to it but it is generally the most agreeable match to my abnormality I've found in a preset so far.


Personaly I'm in love with Monokai: https://twitter.com/#!/ciembor/media/slideshow?url=pic.twitt.... But I think even the most beloved themes bores after some time:).


Ohhh boy you brought back memories of Textmate for me! I used to use Monokai also. Great color scheme! Loved it until I found a need to have a bit less contrast in my code. For some reason I got so used to the contrast that I only saw stuff in the pink/fushia and my mind completely ignored the rest.


Nice, although I prefer "solarized" http://ethanschoonover.com/solarized blinks theme with zsh


Attention please! There was a bug:D. Magenta was inverted with cyan. It's corrected now. Sorry for any problems.


I did what is mentioned, but nothing happens

Go to http://ciembor.github.com/4bit. Design your terminal look. Click .Xresources button and save it to ~/.Xresources. Run xrdb ~/.Xresources. Get back to work (or to the first step).


Someone on polish wykop.pl told me, that this way works only with terminals based on libXt (for example xterm, aterm, eterm, urxvt). Someone else want to contribute and write export to other terminals, that would be very nice:). If you want to use these colors right now, you may just copy hex codes into your terminal's configuration.



Pretty awesome. One thing that puzzles me is that the preview is showing a fish prompt, but it only outputs an Xresources file.


This is brilliant. Awesome work dude.


Thanks! I spent the last three days coding this, and now I only hope it will stand out anywhere:).


Thanks for sharing this! This looks awesome.


Very cool.


genius




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: