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.

The mplayer that I installed from the repos does not have a default icon associated with it. Hence in the the alt-tab window or in the unity launcher, or any place which requires an icon, it is either empty or an icon with a question mark is shown. How do I assign an icon that will be associated with mplayer?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Someone already reported the bug to the ubuntu makers: Bug #857243: (oneiric) mplayer does not install .desktop file and does not have an icon.


To add an icon manually, create a file ~/.local/share/applications/mplayer.desktop and put the following in it:

[Desktop Entry]
Name=MPlayer
GenericName=Media player
Exec=mplayer %U
TryExec=mplayer
Icon=totem
Type=Application
Categories=AudioVideo;Player;
NoDisplay=true

Here the totem media player icon is used.

Correct mplayer icon

$ cd ~
$ wget http://upload.wikimedia.org/wikipedia/commons/8/81/MPlayer.svg
$ cd /usr/share/icons/hicolor
$ for i in *x*; do sudo convert -background none ~/MPlayer.svg -resize $i $i/apps/mplayer.png; done
$ sudo gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor

Then edit the mplayer.desktop and set Icon=mplayer.

That's it. You downloaded the mplayer icon from wikipedia, converted it to .png files of different resolution and cleaned up the icon cache.

share|improve this answer
    
There is typo in 4th command line (Mplayer.svg) and also *x* pattern is not good as it catches also "index.theme" file, which breaks conversion, so above should be fixed –  zetah Apr 23 '12 at 19:56
1  
fixed the typo, but while index.theme gets matched, it just fails and continues. –  cweiske Apr 24 '12 at 5:50
    
The .desktop posted is basically worthless, mplayer is a cli app. As written it will do nothing, not even useful as a DnD launcher icon due to lack of a MimeType= line. The same can be said for the bug report, though I did post a DnD example .desktop there –  doug Apr 24 '12 at 6:30
    
doug, it is not worthless: it makes gnome shell display the mplayer icon in the app switcher. btw, mplayer is not a pure cli app since it displays a window - the movie. –  cweiske Apr 24 '12 at 6:47

try using UMplayer its mplayer with a nice ui,or make a launcher and add a icon of your choice,right click on the desktop than make new launcher give it a name and a command,then click on the little icon and browse for a new icon of your liking,form there drag and drop it into the unity launcher and put the launcher that you made some were for safe keeping.

share|improve this answer
    
Or the more commonly suggestes SMplayer, available from the Software Centre. The reason that "mplayer" doesn't have an icon is that its GUI is more or less unsupported and has been for many years. –  loevborg May 2 '11 at 18:35
    
Can you even make launchers anymore in Unity in latest Ubuntu 11.x? –  Warren P Oct 16 '11 at 17:44

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.