SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-30 16:34:59

Barnes
New Member
Registered: 2012-10-30
Posts: 8

Managing Tint2 Unthemed Icons

MANAGING TINT2 UNTHEMED ICONS

Have you noticed how some applications fail to follow your carefully chosen icon theme and end up displaying an often uglier default in your panel?

It's not earth shattering stuff, but it does niggle away at you after a while. Well, here's one way to bring back some temporary sanity using wmctrl, xprop and xseticon.

We'll use very simple bash scripts to change the application icon with xseticon then additionally set a new window name with wmctrl.

On the negative side, you'll see the icon change take place, as we need to wait for xseticon to get the appropriate WINDOWID; but on the plus side, you'll end up with a better looking panel.


A.  Install the necessary software:

    * x11-misc/wmctrl
    * x11-apps/xprop
    * media-libs/gd
    * x11-libs/libXmu


B.  Download and install xseticon [Debian 64-bit prebuilt package; or build from the original sources]:

    1. Debian 64-bit package : http://packages.leonerd.org.uk/pool/main/x/xseticon look for xseticon*amd64.deb
    2. Original sources : http://sourceforge.net/projects/xseticon/files look for xseticon*tar.bz2


C.  If, like me, you decided to take the easy way then extract the .deb package and install the xseticon executable and support files:

    open a terminal...
    # ar p xseticon*amd64.deb data.tar.gz | tar zx
    # sudo cp usr/bin/xseticon /usr/bin
    # sudo cp -r usr/share/doc/xseticon /usr/share/doc
    # sudo cp usr/share/man/man1/xseticon.1.gz /usr/share/man/man1
   
   
D.  Here are four programs I regularly have problems with in terms of default (ugly) icons when using tint2:

    * Audacity
    * Handbrake (ghb)
    * MkvmergeGUI (mmg)
    * Gimp
   
   
E.  We'll use a simple bash script to launch the application then change both its icon and window name:

    1. Here's an example script created for the application 'handbrake' (ghb)
    2. Copy the script and name it 'up-ghb'
    3. Make the file executable
    4. Copy the executable script to a local bin location   

    open a terminal...
    # nano $HOME/Documents/up-ghb
    # chmod +x up-ghb
    # sudo cp up-ghb /usr/local/bin
   
      ---- copy and paste ----

      #!/bin/bash

      # Handbrake launcher

      # Application launcer to reset icon and name
      # Requires : wmctrl, xprop, xseticon

      function ghb-up {

      sleep 2
      activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
      activeWinId="${activeWinLine:40}"
      iconStore="$HOME/.icons/launchers"

      xseticon -id "$activeWinId" "$iconStore/ghb.png"
      wmctrl -i -r "$activeWinId" -T "Transcoder"

      }

      ghb & ghb-up

      ---- copy and paste ----
     
     
F.  The script "up-ghb" runs handbrake first then the "ghb-up" function which changes the displayed icon and window title:

    1. You'll need to tell xseticon where to find the icons (iconStore), so make sure you have some ready to go
    2. For use with other apps simply change the application and funtion references, the icon chosen and the window title
    3. Here are the 'sleep' times in seconds that have worked for me with the applications mentioned
   
    * Audacity [ 3 ]
    * Handbrake [ 2 ]
    * MkvmergeGUI [ 2 ]
    * Gimp [ 3 ]

   
G. For permanent use amend your application launcher reference from audacity to up-audacity:

    open a terminal...
    # nano $HOME/.config/openbox/menu.xml
   
      <item label="Audio Editor" icon="/usr/share/icons/openbox-bc/audacity.png" >
        <action name="Execute">
          <command>
            up-audacity
          </command>
        </action>
      </item>


All done

Last edited by Barnes (2012-12-03 12:10:00)

Offline

Be excellent to each other!

#2 2012-10-30 17:25:11

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,081

Re: Managing Tint2 Unthemed Icons

Good tutorial! I will have a go at this soon... smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo