2

I am using gnome-terminal 3.6 on Ubuntu 14.04.

I recently decided to try the Solarized color scheme. This involves making a few changes:

  1. Making a Gnome terminal profile with the Solarized colors: https://github.com/Anthony25/gnome-terminal-colors-solarized
  2. Setting the LS colors: https://github.com/seebi/dircolors-solarized
  3. Setting my vim color scheme: https://github.com/altercation/vim-colors-solarized

I want to do #2 and #3 only if #1 has already been done. Eg, if I'm using the default terminal profile, trying to use solarized-vim looks horrible, so I would like to use a different color scheme for vim in that case.

Does gnome-terminal provide the shell any information about what profile it is running (eg, setting an environment variable or something), or is my challenge of automatically adapting across multiple terminal profiles impossible?

Thanks!

0

Check whether $COLORFGBG is set, but as far as I recall it is not.

There are escape sequences to query the actual color, try the command xtermcontrol --get-fg but I'm almost sure that these weren't yet supported in Trusty.

If neither of the above worked:

Actually it's not gnome-terminal but the underlying libvte that matters. Install vte3 - 1:0.36.3-1ubuntu1~trusty1 (it's multiple packages, upgrade all that are currently installed) from Gnome3 Staging (https://launchpad.net/~gnome3-team/+archive/gnome3-staging/+packages) and restart gnome-terminal. The xtermcontrol --get-bg command should work now. (You'll get a much newer terminal engine with line rewrapping on resize and other cool features & bugfixes as well.)

(Disclaimer: Make sure that xterm is installed and you can download the files of original vte3 belonging to your distribution, so that you can still restore the system in case anything goes wrong during the update. It won't go wrong, but still, be precautios.)

  • $COLORFGBG isn't set. xtermcontrol doesn't seem to be supported in Trusty. Will check out the next solution -- thanks! – Sam King Sep 4 '15 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.