Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I frequently run a windows program with wine. When I open this program it shows up in the unity launcher as wine instead of the actual opened program.

I have made a desktop launcher with the right icon but dragging this to the unity launcher reverts the icon back to the wineglass icon. When starting the application it's denominated as Wine Windows Program Loader instead of its actual name.

Screenshot:

enter image description here

share|improve this question
1  
try to edit .desktop file –  geoh Apr 29 '12 at 18:13
add comment

7 Answers 7

Workaround on Ubuntu 12.04 LTS


Note

This workaround requires a working launcher for your Wine application. Here's a tutorial on how to create one. The workaround also applies to applications installed with PlayOnLinux scripts.

Instructions

Open your .desktop launcher in your favorite text editor and append this line to the file:

StartupWMClass=application.exe

where application.exe is the base name of the executable you want to launch in Wine.

Don't use the the full path, only the base name. And make sure it's unqoted (a general rule you should follow with desktop files).

Result

Application icons and descriptions should be rendered fine now:

enter image description here


Source: https://bugs.launchpad.net/unity-2d/+bug/702452

share|improve this answer
    
I can confirm, that this works also with PlayOnLinux Applications on Ubuntu 12.04 –  TIIUNDER Feb 2 '13 at 17:20
2  
I should clarify that it should be only the name of the executable, not the full path, no quoting, or anything extra of that sort. –  Jonah Jul 17 '13 at 3:50
1  
I can confirm that this worked with Ubuntu 13.10 . @Jonah Can you please edit your answer and add that little detail cause it's really important :) –  thelinuxer Oct 25 '13 at 17:11
1  
@thelinuxer Glad the answer helped you. I edited the part Jonah pointed out. –  Glutanimate Oct 25 '13 at 20:47
    
Here's my variation, works for 14.04: if it's available, select "create desktop shortcut" in the app's installer. Then move this shortcut to /usr/share/applications, and add the StartupWMClass=XXX.exe line to it (for instance using gksudo gedit XXX.desktop) –  dominic999 May 2 at 19:34
add comment
  1. This is where you will find your icons or place your custom icons in here:

    $ cd ~/.local/share/icons/hicolor/256x256/apps/
    $ ls
    1DF1_PicasaPhotoViewer.0.png
    .
    .
    .
    29F5_WINWORD.0.png
    850A_EXCEL.0.png
    AA79_POWERPNT.0.png
    
  2. Go to the following directory:

    $ cd ~/.local/share/applications/wine/Programs/Microsoft\ Office
    $ ls
    Microsoft Excel 2010.desktop\
    Microsoft Office 2010 Tools\
    Microsoft PowerPoint 2010.desktop\
    Microsoft Word 2010.desktop\
    
  3. Edit .desktop files:

    $ sudo nano Microsoft\ Word\ 2010.desktop
    [Desktop Entry]
    Name=Microsoft Word 2010
    .
    .
    .
    Icon=29F5_WINWORD.0.png (or name of icon as in above folder)
    
  4. You are done!

share|improve this answer
    
Do you have any idea why I am able to use the existing icon of Word in the Icon folder, but not something I put in that folder myself, to use in my .desktop file? –  Anh Dec 5 '13 at 3:43
    
Nevermind. It seems like the icon must be .png instead of jpg? –  Anh Dec 5 '13 at 3:49
add comment

There are several logged bugs on this issue.

In one of the bugs (post 3), someone has reported a possible workaround. However two further posts below that note that it doesnt always work.

share|improve this answer
add comment

I'm not using Unity, so I really don't know if it will work.

You problem could be beacause of the program launcher. I assume your .desktop file contains Exec=wine '/home/user/.wine/dosdevices/c:/Program...' and so on. Try making a bash binary wich contains something like this:

#!/bin/bash
cd '/home/aldomann/.wine/dosdevices/c:/Archivos de programa/Warcraft II BNE'
wine 'Warcraft II BNE.exe'

Name it for instance warcraft2 and move it to /usr/bin (or any PATH variable, wich you can know by typing echo $PATH on the Terminal)

Then in your .desktop file instead of Exec=wine '...' use Exec=warcraft2. I think Unity will assume this is not a wine program and will use your icon, but it is only conjecture.

Hope it works ;)

By default your Wine apps .desktops are placed on /home/user/.local/share/applications/wine

Instead of modifying an existing .desktop file you can create a new one and place it on /home/user/.local/share/applications. It should be something like this:

[Desktop Entry]
Name=Application
Comment=Comment
Exec=app-binary
Icon=app-icon
Type=Application
Terminal=false
StartupNotify=true
Categories=GTK;Utility

Tip: If you place your icon on /home/user/.icons/ (i.e app-icon.png) you will only have to put Icon=app-icon.

share|improve this answer
    
I am not sure how to find the .desktop file to give this a shot. –  zorkerz May 3 '11 at 22:17
    
It should be on /home/user/.local/share/applications/wine –  Alfredo Hernández May 3 '11 at 22:41
add comment

Use Alacarte (the old menu editor, you might need to install it) to create an old style menu entry with an icon and a executable that launches your program. Than search for this via alt + F2 and pin it to the launcher.

share|improve this answer
add comment

You can easily change any installed program in your Ubuntu using "Main Menu" (package name is "alacarte"). You can download it from Software Center by typing "Main Menu" and then:

enter image description here

  1. Run "Main Menu" program.
  2. From right panel called "Menus" find your program (in this case it is in "Wine" node) and select it in "Items" panel.
  3. Click on properties button.
  4. From showed dialogue select icon button that located on top left.
  5. Finally browse the location of your new icon in your file system.

After doing above steps you will see your new icon in Unity launcher and panel.

Have a nice time.

share|improve this answer
    
Saeed I don't think you really understand the question. Sure it may be possible to change the icon of any program as you've described, but the point is that Wine is a wrapper for a number of different programs - so one must change the icon depending on the actual program being run. You describe a way to change the Wine icon - not the underlying program. –  user101181 Oct 26 '12 at 19:59
    
However, Alacarte can be used just for that (you just need to put wine your_program into the executable field). –  sup Feb 13 '13 at 11:51
add comment

I had the same issue, and I found out it was because I put the shortcut files (that PlayOnLinux places on the Desktop) into a separate folder. I took them out of the folder and put them on the Desktop and it works fine (the icon is displayed). Hope this helps!

share|improve this answer
add 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.