2

I frequently use Tox for communication, in particular the μTox client. I recently switched to Ubuntu from Debian, and am finding it a nice alternative, but I have one constant problem; because I often use μTox, I wish to pin it to the taskbar. I have written a custom .desktop entry and it shows up in the Unity Dash, but because of the way μTox is written, when I click on it in the Dash, it opens first the actual μTox process, but that then hides itself and opens a different window called μTox (Alpha) (version: 0.8.1), meaning I am unable to pin it to the taskbar as it is a child process of the original utox process my .desktop file runs.

So how can I pin μTox to the taskbar?

Jacob Vlijm
  • 82,471
  • 12
  • 195
  • 299
  • 1
    Just for my understanding, you want to pin (minimize) an existing window to the *panel*, not to the launcher? Interesting, can be done. At the same time, if you minimize a μTox window, can't you reach it by right-click its icon?. Please let me know, I have to run, but if needed, will write a solution, because it's fun :) – Jacob Vlijm May 21 '16 at 08:53
  • @JacobVlijm What's the difference? (Sorry, I'm a Debian person). –  May 21 '16 at 08:55
  • @JacobVlijm Ah, OK. I meant the _launcher_. –  May 21 '16 at 08:56
  • @JacobVlijm Note that for me, μTox is 'installed' simply as a single file in `~/bin`. –  May 21 '16 at 09:13
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/40096/discussion-between-george-gibson-and-jacob-vlijm). –  May 21 '16 at 09:16
  • Hi George, posted my answer. Please let me know if you manage. – Jacob Vlijm May 21 '16 at 18:09

1 Answers1

0

It took me a while before I understood what you actually meant, but here is the answer:

Missing WM_CLASS

When you say:

"when I click on it in the Dash, it opens first the actual μTox process, but that then hides itself and opens a different window called μTox (Alpha) (version: 0.8.1)"

...it is a small misinterpretation of what is happening; there is no second process, but the launcher you created and the application do not "meet" each other in the Unity Launcher. In other words: the home-made launcher does not recognize the window, μTox is calling, as "his".

How to solve

You can simply solve it by including the WM_CLASS to your launcher, so it will correctly recognize the μTox -window:

StartupWMClass=utox

A simple launcher that worked fine here:

[Desktop Entry]
Name=Some Tox
Exec=/home/jacob/Downloads/utox
Type=Application
StartupWMClass=utox

Of course you need to replace the path in the line Exec=/home/jacob/Downloads/utox

...But you might want to include an icon. If so add the line:

Icon=/path/to/toxicon.png

enter image description here

...and your issue should be solved :)

How to find the WM_CLASS?

  • Open a terminal, type

    xprop WM_CLASS
    

    Press Return and click on the μTox window.

enter image description here

Jacob Vlijm
  • 82,471
  • 12
  • 195
  • 299
  • Yes! Thank you, this appears to be just what I need. I've already done an icon, but did not know of the `StartupWMClass` option. –  May 21 '16 at 18:48