0

Nautilus in Ubuntu has dynamic icon, which means it changes during runtime then changes back. It changes in the Unity bar etc. for example when copying a file we see a progress icon.

I was wondering how is this done? I would like to make my applications icon dynamic too, for example during a process I would like to replace my icon with another icon ( i created that has a mini image of a can in the top left corner).

https://code.launchpad.net/~3v1n0/ubuntu/oneiric/nautilus/unity-launcher-support/+merge/70685

i found this here:

https://www.mail-archive.com/search?l=desktop-bugs@lists.ubuntu.com&q=subject:%22[Bug+821598]+Re%3A+Show+progress+bar+in+nautilus+icon+on+launcher+when+the+user+copy+file%22

If anyone can share with my the API function calls, I'm trying to convert this to ctypes.

The dynamic icon is demonstrated in this youtube video: http://www.youtube.com/watch?v=kpXlKM-9mIA

Noitidart
  • 35,443
  • 37
  • 154
  • 323
  • Unity icons are normal X11 icons controlled by the _NET_WM_ICON window property. They are more like launcher icons. There are no common X11 APIs for changing them. You need to work with Unity-specific APIs. – n. m. could be an AI Nov 24 '14 at 21:35
  • 1
    @n.m. that's what I originally thought but it's not completely true: icons are set in .desktop file and then you need to associate .desktop file with a window by setting _NET_WM_DESKTOP_FILE property - see my question & answer - http://askubuntu.com/questions/530376/association-window-desktop-file-launcher-entry . Unity does a lot of things in a non-EWMH way – Andrey Sidorov Nov 24 '14 at 23:21
  • 1
    _NET_WM_DESKTOP_FILE is not standard, it's a Unity thing. – n. m. could be an AI Nov 25 '14 at 03:31

1 Answers1

3

No, nautilus is not changing icon. Instead, it tells to launcher "hey, please set progress to X% and label to xyz". You can find some documentation here. As far as I know unity launcher does not respect dynamic change of icon via ewmh ( _NET_WM_ICON & friends ) and all working solutions are very hackish: edit .desktop file and send some signals to notify it's changed (looks like you already seen related answer)

Community
  • 1
  • 1
Andrey Sidorov
  • 24,905
  • 4
  • 62
  • 75
  • Thank you Andrey! Thanks also for the link in your comment, I think creating a new desktop file with my icon and then sending messages ( _NET_WM_DESKTOP_FILE path is what) I need to do! – Noitidart Nov 25 '14 at 01:17
  • Are you actually trying to change the icon or need overlay progress/label like in linked youtube video? – Andrey Sidorov Nov 25 '14 at 02:39
  • Well I need to change the icon, I thought they were able to overlay badge elements in there. Basically my addon for firefox it allows multiple profiles, and people want to set a mini 16x16 or 8x8 badge in lower corner of icon, so in windows and mac i just create a new icon and replace it (runtime). I thought thats what Nautilus was doing but its not so Ill have to use the hackish methods, which is ok, its perfect for an addon :) – Noitidart Nov 25 '14 at 05:39