! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
custom icons for removable volumes
Status:
RESOLVED: INVALID
Severity:
enhancement

Comments

Description Brian J. Tarricone (not reading bugmail) 2006-11-07 17:12:35 CET
I'd like the ability to set custom icons for removable volumes somehow.  I dug around in HAL, but it doesn't look like it provides an icon name; that appears to be done in the VFS layer, which I believe it just using some defaults for thunar-vfs's particular volume types.

For example, I have an iPod.  The Tango icon theme provides a bunch of 'multimedia-player-ipod-*' icons (not to mention some for other players as well).  It would be nice to be able to use this icon instead of the default multimedia player icon.  Having to set it manually is, of course, fine.  Magically figuring out the color of my iPod and picking the correct icon would be awesome, though ^_~
Comment 1 Benedikt Meurer editbugs 2006-11-07 17:18:06 CET
That'd indeed be very nice. lookup_icon_name() is a virtual method of ThunarVfsVolume and could easily be reimplemented in thunar-vfs-volume-hal.c. Check what HAL knows about iPods.
Comment 2 Brian J. Tarricone (not reading bugmail) 2006-11-07 18:43:52 CET
(In reply to comment #1)
> That'd indeed be very nice. lookup_icon_name() is a virtual method of
> ThunarVfsVolume and could easily be reimplemented in thunar-vfs-volume-hal.c.

Ah, cool, I'll have to look at that.

> Check what HAL knows about iPods.

Well, it can tell based on info.vendor ('Apple') and info.product or storage.model ('iPod'), but that's set for the HAL parent item of the actual volume.  Annoyingly, the volume itself doesn't have info.vendor, and info.product is set to the volume label, but that shouldn't be hard to work around.

The other 'problem' is that HAL just can't get enough info to make everyone happy.  For example, the tango-icon-theme-extras package actually has separate icons for blue iPod, green iPod, etc.  There's no way to get this info from HAL, so it would be a case where the user might want to override the icon manually.

I don't really like that all that much, though.  In the meantime I'd be willing to settle for the method you described.  I'll look into it later today if I have time.
Comment 3 Brian J. Tarricone (not reading bugmail) 2006-11-08 08:43:04 CET
Created attachment 861 
custom ipod icon patch

Ok, this patch works for me.  The icon names aren't in the standard, though, so who knows what icon themes will support them (other than Tango).  Tango also has Dell and Motorola player icons, but I couldn't figure out how to detect them.

Also, as noted in the code comment, it seems possible to get a finer-grained idea of what kind of iPod it is (mini, nano, video, etc.), but I can't seem to figure the best way to get the UDI of the HAL object that has that information.  It's in info.product of the 'toplevel' item for the drive.  On my system I have:

EHCI Host Controller
` iPod mini
  + USB Raw Device Access
  ` USB Mass Storage Interface
    ` SCSI Host Adapter
      ` SCSI Device
        + SCSI Generic Interface
        ` iPod
          + Volume
          ` Brian's iPod

The UDI of the ThunarVfsVolume is "Brian's iPod".  I can't get up to the toplevel "iPod mini" by any other method than just walking up each parent, which doesn't seem to me to be the best idea.  The hierarchy might be different for different devices, and will probably be different depending on if you connect an iPod via Firewire rather than USB.

"Brian's iPod" has block.storage_device, which points to "iPod", which has portable_audio_player.type (which is 'ipod' in this case).  I think that's the best I can do for now.

It would still be nice for the user to be able to override the icon via some UI (or even a text file somewhere), but I still don't really like the complexity that adds, really.
Comment 4 Benedikt Meurer editbugs 2007-01-06 21:29:58 CET
Getting back to this one... I can't seem to find the portable_audio_player.type property documented in the HAL specification. Can you post the hal-device output of the associated devices?
Comment 5 Benedikt Meurer editbugs 2007-01-12 17:54:24 CET
This is something for exo-hal now.
Comment 6 Simon Steinbeiss editbugs 2015-02-17 00:01:28 CET
As Thunar meanwhile doesn't use thunarvfs anymore and hal is dead, I'd say this is invalid.

Bug #2538

Reported by:
Brian J. Tarricone (not reading bugmail)
Reported on: 2006-11-07
Last modified on: 2015-02-17

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
0.3.1.13svn

Attachments

custom ipod icon patch (5.44 KB, patch)
2006-11-08 08:43 CET , Brian J. Tarricone (not reading bugmail)
no flags

Additional information