diff --git a/applet/contents/code/icon.js b/applet/contents/code/icon.js --- a/applet/contents/code/icon.js +++ b/applet/contents/code/icon.js @@ -69,3 +69,16 @@ } return ""; } + +function prettyIcon(type, formFactor, IconName) { + var icon = formFactorIcon(formFactor); + if (!icon) { + icon = IconName; + } + // Instead of showing a generic card icon show a speaker or microphone icon + if (icon === "audio-card" || icon === "audio-card-pci") { + var isPlayback = type.substring(0, 4) === "sink"; + icon = isPlayback ? "audio-volume-high" : "audio-input-microphone"; + } + return icon; +} diff --git a/applet/contents/ui/DeviceListItem.qml b/applet/contents/ui/DeviceListItem.qml --- a/applet/contents/ui/DeviceListItem.qml +++ b/applet/contents/ui/DeviceListItem.qml @@ -39,5 +39,5 @@ } } labelOpacity: onlyOne ? 1 : 0.6 - icon: Icon.formFactorIcon(FormFactor) || IconName + icon: Icon.prettyIcon(type, FormFactor, IconName) }