13

Running in xterm (or gnome-terminal) the following command sets the so-called "Icon Name":

echo -en "\e]1;some_value\a"

What does this do?

Note that it is possible to set both "Window Title" and "Icon Name" to the same value with the same command, so I don't understand how "Icon Name" could be a path to, say, an image.

2 Answers 2

19

A long time ago, there was a window manager called twm—actually, it still exists and runs perfectly well. Instead of minimizing a window to a bar at the bottom of the screen (or similar) like MS Windows, Mac OS X, and many modern window managers, it shrunk them to labeled icons ("iconfify").

The Wikipedia twm article has some nice pictures, such as:

Screenshot from TWM

The window title is what goes in the titlebar (e.g., the "Calculator" or "xterm"). The icon name is what goes under the icon when iconified (the "xclock"). Modern window managers probably all ignore the icon name because they don't use the icon UI.

A full description of both can be found in the ICCCM.

1
  • 2
    Windows 3 used to iconify like that. Commented Oct 6, 2015 at 7:58
5

I'll talk about xterm here: it's an old piece of software and much of its terminology is now outdated. In man xterm it says:

    iconName (class IconName) 
            Specifies a label for xterm when
            iconified.  Xterm provides no default value; some
            window managers may assume the application name, e.g.,
            "xterm"

            Setting the iconName resource sets the icon label
            unless overridden by zIconBeep or the control sequences
            which change the window and icon labels.

That means that iconName must not be an icon image, it's just a label that's given to xterm window when it's iconified. It can be also set using -n option:

-n string
        This option specifies the icon name for xterm's windows.  It
        is shorthand for specifying the "iconName" resource.  Note
        that this is not the same as the toolkit option -name (see
        below).  The default icon name is the application name.

After starting xterm like this, with a title != iconName I still can't see ICON string being shown after iconifying xterm window (Alt-F9 in fluxbox):

$ xterm -n ICON -T a-new-title

Digging further through xterm manpage one finds (** mine):

   activeIcon (class ActiveIcon) 
           Specifies whether or not active
           icon windows are to be used when the xterm window is
           iconified, if this feature is compiled into xterm.  The
           active icon is a miniature representation of the
           content of the window and will update as the content
           changes.  Not all window managers necessarily support
           application icon windows.  Some window managers will
           allow you to enter keystrokes into the active icon
           window.  The default is "default".

           Xterm accepts either a keyword (ignoring case) or the
           number shown in parentheses:

           false (0)
                  No active icon is shown.

           true (1) 
                  The active icon is shown.  If you are using
                  twm, use this setting to enable active-icons.

           default (2) 
                  Xterm checks at startup, and shows an
                  active icon only for window managers which it
                  can identify and which are known to support the
                  feature.  **These are fvwm (full support), and
                  window maker (limited).**  A few other windows
                  managers (such as twm and ctwm) support active
                  icons, but do not support the exten- sions which
                  allow xterm to identify the window manager.

activeIcon is probably not directly related to iconName feature, however it gives us a clue that icon-related features in xterm work correctly only with some window managers. I recommend Xephyr for testing one either fvwm or window maker as specified in the manpage:

$ Xephyr :1 -ac -screen 800x600

and in another terminal:

$ DISPLAY=:1 wmaker

Now let's start xterm inside window maker: right click -> Applications -> Terminals -> xterm. Start xterm with -n option again:

$ xterm -n ICON -T a-new-title

Right click on the title bar and choose Miniaturize. Now you can see that an xterm icon is actually labeled ICON. Bring it back by clicking on it and see that titlebar is a-new-title. The conclusion is that iconName feature works only with some window managers, most probably older ones. If you feel strong you can browse window maker source code and patch your own window manager if it doesn't support iconName.

BTW, for changing xterm icon image see this: https://superuser.com/questions/344320/how-do-i-change-the-icon-of-an-xterm.

1
  • Active icons are basically a different window state -- rather than hiding the window, it is switched to "icon" state. This is still a regular window though, and the program can draw normally, so program state can be shown in the icon if desired. Commented Oct 6, 2015 at 11:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.