2

I am looking to see if there is a way to implement the solarized them through just a .bashrc file. Would it be possible to do so? Has anyone tried this before?

I guess I would start by modifying something similar to this:

 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
Ross
  • 153
  • 1
  • 1
  • 7

2 Answers2

2

As a general practice, I try to keep this level of configuration in my Terminal Emulator. At most, I only use 2-3 Terminal Emulators (Terminal.app on my Mac, Gnome-terminal on my Linux machine, maybe something in PuTTY), so there are only 2-3 configurations to worry about.

Bashisms, and especially bash-colorisms have many tiny differences from OS to OS, Bash version to bash version and user to user (Are you going to use the same .bashrc for yourself and for root? On all systems? Probably not.) If you manage many systems, this solution becomes unscalable.

There will be many little tweaks to get this working on all of the hosts that you use, and it's difficult to keep .bashrc/.bash_profile in sync on all of those systems. Although "Get Settled in Quickly with movein.sh" can help you here.

Also see Colorizing your terminal and shell environment? on http://unix.stackexchange.com.

Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
0

This is a color scheme, so your question doesn't really make sense. An application can use the color scheme to select which colors to display: I see terminal emulators for each platform are already covered, so using those would work. And I also see that there's support for most coding applications that use colored syntax highlighting: vim, emacs, Xcode, Visual Studio among others.

Setting colors in a bashrc doesn't make sense. Your example is selecting colors out of a palette to colorify parts of the bash prompt. The solarized theme is the color palette; you can do what you want with it after it's configured.

If you'd like to set up the palette in gnome-terminal or Eterm, nothing's stopping you from doing so. But you can't set a palette in your bashrc.

Michael Lowman
  • 3,604
  • 20
  • 36
  • 1
    i connect to various servers, some are coloured and some not. I was presumed this was due to the .bashrc config, however this assumption may be wrong. I use various different servers, applications and OSs. I was wanting to make a .bashrc file for my dev server only. – Ross Jul 21 '11 at 21:49
  • When you have a PS1 setting that's colorized, it's done with [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_colors#Colors). You can use your terminal to specify what, say, a bold green should be displayed as. Within bash, you're limited to the options at that link – Michael Lowman Jul 22 '11 at 00:07