diff options
author | Christian Hesse <mail@eworm.de> | 2015-06-19 11:19:43 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2015-06-19 11:19:43 +0200 |
commit | 6dead1437d4fc2e9e989ee1d6163a406f0f48f95 (patch) | |
tree | 3ea86273aa78651432237b4ff17f87f0bdf9a53f | |
parent | 5e154ddc24376a949f0a5d8c0f6980e550b5e69f (diff) | |
download | udev-block-notify-6dead1437d4fc2e9e989ee1d6163a406f0f48f95.tar.gz udev-block-notify-6dead1437d4fc2e9e989ee1d6163a406f0f48f95.tar.zst |
detect CD audio and use media icon
-rw-r--r-- | config.def.h | 1 | ||||
-rw-r--r-- | udev-block-notify.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h index e5b5cf0..aca1ba0 100644 --- a/config.def.h +++ b/config.def.h @@ -20,6 +20,7 @@ #define ICON_LOOP "media-playlist-repeat" #define ICON_MEDIA_FLASH "media-flash" #define ICON_MEDIA_FLOPPY "media-floppy" +#define ICON_MEDIA_OPTICAL_CD_AUDIO "media-optical-cd-audio" #define ICON_MEDIA_REMOVABLE "media-removable" #define ICON_MEDIA_ZIP "media-zip" #define ICON_MULTIMEDIA_PLAYER "multimedia-player" diff --git a/udev-block-notify.c b/udev-block-notify.c index 30bc597..5d0652c 100644 --- a/udev-block-notify.c +++ b/udev-block-notify.c @@ -209,7 +209,11 @@ int main (int argc, char ** argv) { /* decide about what icon to use */ value = udev_device_get_property_value(dev, "ID_BUS"); if (udev_device_get_property_value(dev, "ID_CDROM") != NULL) { /* optical drive */ - icon = ICON_DRIVE_OPTICAL; + if (udev_device_get_property_value(dev, "ID_CDROM_MEDIA_TRACK_COUNT_AUDIO") != NULL) { + icon = ICON_MEDIA_OPTICAL_CD_AUDIO; + } else { + icon = ICON_DRIVE_OPTICAL; + } } else if (udev_device_get_property_value(dev, "ID_DRIVE_FLOPPY") != NULL) { /* floppy drive */ icon = ICON_MEDIA_FLOPPY; } else if (udev_device_get_property_value(dev, "ID_DRIVE_THUMB") != NULL) { /* thumb drive, e.g. USB flash */ |