Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Besides evilvte, is there any terminal emulator on Linux which (without crashing) allows me to, on a per host basis, specify both cursor, foreground and background color and also icon (that is, the icon shown when the running application is minimized)?

I'm doing SSH into a quite large number of different hosts and to make it easier for me to keep track of which host I'm logged on to, each host has a unique color scheme (that is, an unique combination of background, foreground and cursor color) I use for it's terminal Windows. To make it easier to instinctively navigate properly between these terminal sessions, I also rely on customizing the terminal emulator setup so the icon used for it when it is minimized (or when doing ALT-TAB in my XFCE desktop) is reflecting the color scheme it is using.

(I have a perl program that generates an terminal graphic with background, foreground and cursor colors matching the color scheme I use for the host, so I can easily generate an appropriate icon for every host I'm supposed to work with)

The problem with this approach is not that it does not work (it does indeed work as a charm!), but that it is hard to pick a good enough terminal emulator which does support all of the following:

  • Per session customizable icon graphics (in the sense I can specify any image on disk).
  • Per session customizable background, foreground and cursor color.
  • Preferably also per session customizable ANSI colors (including 'bright' colors 8 to 15), simply because if the background color is red, I want to tweak the ANSI red and bright red so they differ a bit from the background color. (Yes, I got a script that automates that tweaking too)

Right now I rely on evilvte because it is the only terminal software that allows me to customize both the icon as well as all colors (cursor, foreground, background, bold, dim and all of the ANSI ones). The problem with evilvte is that I have to compile one separate binary per session (partially automated and works but frankly quite ugly approach). Also, evilvte does not support that you decrease width or height of the terminal window (that is, decrease the number of columns or rows) in spite of allowing you to increase width/height. Another potential problem with evilvte is that I've done a fairly ugly hack to tweak all ANSI colors for it which might or might not work for future evilvte versions.

I have tried gnome-terminal, but it did originally lack the ability to customize the cursor color and once one included support for that it was decided to remove the ability to customize the icon on a per session basis.

Any pointer to a terminal that provides all the features I need but without the headaches I get when using evilvte would be appreciated.

Edit: Matt Jenkins provide a good and well written answer where he suggests that I use xterm and provide some good hints for howe to use it. Unfortunately, xterm do have some limitations that makes it unsuitable for my needs (xterm only support monochrome black and white icon pixmaps and it has hard coded, compiled in ANSI colors). So, I did not accept his answer (clicking the checkmark) but I still "upped" it one point.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

It would seem that "konsole" is your friend.

After an extensive investigation into multiple terminal programs I have found:

  • konsole supports setting custom colour schemes:

enter image description here

  • konsole supports custom icons:

enter image description here

  • konsole supports multiple profiles - no need for scripting. Just create a new profile for each server. You can even include the ssh command in the profile to auto-login to the server.

enter image description here

Oh, and konsole is tabbed too, so you can reduce clutter, and group servers together in less windows. (Maybe all your web servers in one window, all your file servers in another, etc).

For setting the icon in the window manager (that's a separate icon to the "profile" icon) you need to specify the --icon flag to the konsole command:

$ konsole --icon /usr/share/icons/oxygen/16x16/apps/java.png

Which gives:

enter image description here

Coupling that with --profile should yield the result you are after.

Note that this window manager icon doesn't change when you change tabs, so it could be used as an icon to identify groups of tabs - say all your web servers - or you don't use the tabs and just stick to 1 window per server.

share|improve this answer
    
have you successfully managed the custom icons to be visible not only in the profile editor and on tabs, but also in the application's own icon (the one seen when doing ALT-TAB in XFCE and when looking at the taskbar in XFCE and other desktop environments)? I customized the icon for one of my profiles but konsole still insists on showing the default, black konsole icon in the task bar when I use that profile. Frustrating as it in almost all other respects suits my needs. –  IllvilJa Apr 12 '11 at 9:14
    
For that specific icon you have to specify the --icon flag to the konsole command. You can couple it with the --profile to load a specific profile. Doesn't change the icon on a per-tab basis, but if you were grouping your servers by task you could have a "Web servers" icon, etc. –  Majenko Apr 12 '11 at 10:09
    
Thanks a lot! Just tried it out and it works nicely! The icon seen when doing alt-tab is the one I want! That icon also shows up the task bar and the terminal's title bar. There is really only two minor issues: the window title seem to be static (I'm used to xterm/gnome-terminal/evilvte's ability to alter the window title) but that can certainly be worked around somehow. Also, Konsole requires a bunch of KDE + QT libs to be added to my system but I can live with another 36 packages to update from time to time (and they allow me to easily install KDEs superb clipboard utility 'klipper'!!). –  IllvilJa Apr 12 '11 at 11:12
    
    
Hah! Trivial to get the window title to be dynamically set in the same way xterm does it: just specify 'w%' (and nothing else) for both 'Tab Title Format' and 'Remote Tab Title Format'. Now I only need to figure out the optimal size of the icon .png files so I can avoid the icon to be slighty blurred when doing alt-tab. –  IllvilJa Apr 12 '11 at 16:19
add comment

Most Linux terminal software gives you command-line flags to set the behaviour - even the most basic xterm.

Let's address some of your requirements:

  • Per session customizable icon graphics (in the sense I can specify any image on disk).

These have nothing to do with the terminal program. These are "shortcut" icons that launch the terminal program (I think that's what you're after). You should look at the .desktop file format.

  • Per session customizable background, foreground and cursor color.

You should investigate what command-line flags your favourite terminal program has. For example, xterm has -fg and -bg:

$ xterm -fg gold -bg darkblue
  • Preferably also per session customizable ANSI colors (including 'bright' colors 8 to 15), simply because if the background color is red, I want to tweak the ANSI red and bright red so they differ a bit from the background color. (Yes, I got a script that automates that tweaking too)

The ANSI colours are predefined standards. They shouldn't be changed. Most terminal programs will allow you to specify "default" foreground and background from a large palette of colours which are not limited to the normal 16 ANSI colours. For a full list of these colours take a look at the rgb.txt file. It is somewhere in your Linux distro and contains "standard" X11 colours. On Ubuntu it's in /usr/share/X11/rgb.txt.

As an added bit of identification most terminal programs will let you set the window title. For example with good ol' xterm you can use:

$ xterm -bg darkblue -fg gold -title "My terminal"

And even throw in a command to execute:

$ xterm -bg darkblue -fg gold -title "Web Server" -e "ssh myuser@webserver.mycompany.com"

What you end up with is something like this:

enter image description here

Put that command into the target of a "Web Server.desktop" file, along with a pointer to the webserver's icon, and bob's your uncle!

Edit:

I just read the bit about how you want to use the icons.

Setting the icon in the titlebar is a case of setting the "iconPixmap" X resource. This can be done with the -xrm flag to point to an "XBM" file:

$ xterm -xrm '*iconPixmap: /path/to/icon.xbm'
share|improve this answer
    
xterm is nice, even if it is a bit dated (got acquainted with it over two decades ago). It is quite customizable (often on the command line which I like a lot), but for my specific needs it have two issues: 1.) Setting the icon_name seem to have no effect on the displayed Icon. To be honest, after reading the source and then looking through the X Toolkit Intrinsics docs for how Icons are handled I still have not figured out how -n is supposed to work! 2.) ANSI colors are defined at compile time and does not seem to be possible to configure dynamically on a per session/invocation basis. –  IllvilJa Apr 11 '11 at 10:38
    
1) A brief google has shown me this: xterm -xrm '*iconPixmap: /usr/share/doc/tk8.5/examples/images/flagup.xbm' which I have tested and works. 2) The foreground and background aren't defined as ANSI colours, so they can still be unique. TBH I wouldn't mess with the ANSI colours myself. –  Majenko Apr 11 '11 at 10:51
    
Thanks for the tip regarding the use of the -xrm flag. Unfortunately it only supports xbm images which are monochrome and don't support colors (according to dbaspot.com/forums/unix-admin/… this is an issue for all Athena widgets, which is what xterm is made up of. –  IllvilJa Apr 11 '11 at 12:40
    
... continued from previous comment as I prematurely hit "return" and then it took more than 5 minutes to finish the comment. My apologies). Regarding the ANSI colors it is still required they are tweakable for me. The bg color is always used in the terminal, so I want no limits on what color I pick for it. Hence my desire to tweak appropriate ANSI colors instead, as they in contrast to terminal bg, only appears from time to time. –  IllvilJa Apr 11 '11 at 12:47
    
Hmmm... I am struggling to find one terminal that does all these things. The closest I have found is gnome-terminal, but the current version doesn't support changing the icon. You might be able to find an older version that does, but I doubt it. –  Majenko Apr 11 '11 at 13:01
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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