0

After Googling for hours, I didn't find any answer for the following issue and so glad if anyone could help.
I use Ubuntu 12.04 LTS with Gnome-shell 3.4.1. Consider the following simple program in file $HOME/a.py which I have made it executable:

#!/usr/bin/env python
import gtk
w = gtk.Window()
w.set_size_request(250, 150)
w.set_title("test program")
w.connect('destroy', lambda x: gtk.main_quit())
w.show_all()
gtk.main()

I've used MenuLibre to define a_run0.desktop in $HOME/.local/share/applications as below:

[Desktop Entry]
Version=1.0
Type=Application
Name=a_run
Comment=comm.
Icon=applications-development
Exec=/home/vsop/a.py
Path=
Terminal=false
StartupNotify=true
Categories=
Name[en_US]=a_run
Comment[en_US]=comm.

I made a_run0.desktop to be executable and I see a file named “a_run” in $HOME/.local/share/applications with proper icon (Icon=applications-development ). Running the program and using alt-tab, the icon is also shown in alt-tab menu quite well.

The question is, when I copy “a_run” file (actually a_run0.desktop) to $HOME/Desktop, the file is shown with correct icon in Desktop but after running it, the icon shown in alt-tab menu is changed to unknown-red-circle-icon with the name of original file “A.py” underneath.

What is made this problem and how can I see the defined-icon (in .desktop file) correctly in the alt-tab menu after running the program from $HOME/Desktop?

adaf
  • 1
  • 2

2 Answers2

0

Try to add icon to your window using python and gtk. I think that icon in .desktop file only specify how .desktop file is shown in system not application.

user2649114
  • 101
  • 1
  • 1
  • 6
0

Certainly in more recent versions of Gnome shell (I'm using 3.14.1) the entry Icon should point to the actual icon you want to use, e.g

Icon=/home/vsop/a_icon.xpm
loris
  • 450
  • 8
  • 20