Revert "AudioPanel: display device icon in devices tab"

This reverts commit eaa5793399.
This commit is contained in:
Lysec
2026-02-11 14:01:35 +01:00
parent eaa5793399
commit 981d79782b
3 changed files with 1 additions and 91 deletions
-44
View File
@@ -482,48 +482,4 @@ Singleton {
}
Pipewire.preferredDefaultAudioSource = newSource;
}
function getDeviceIcon(node: PwNode): string {
if (!node || !node.properties) {
return node && !node.isSink ? "microphone" : "volume";
}
const props = node.properties;
const isSink = node.isSink;
// Properties to scan for keywords
const searchTerms = [
node.description,
node.name,
props["node.nick"],
props["alsa.card_name"],
props["alsa.id"],
props["device.form-factor"],
props["media.class"],
props["device.profile.name"]
].filter(s => s).map(s => s.toLowerCase());
const hasMatch = (keywords) => keywords.some(k => searchTerms.some(t => t.includes(k)));
if (hasMatch(["hdmi", "displayport", "digital stereo", "monitor", "tv"])) {
return "bt-device-tv";
}
if (hasMatch(["headphone", "headset", "earbud", "earphone", "cloud", "arctis", "major", "minor", "wireless"])) {
return "bt-device-headphones";
}
if (!isSink || hasMatch(["microphone", "mic"])) {
if (hasMatch(["microphone", "mic"])) return "microphone";
}
if (hasMatch(["speaker", "loudspeaker", "internal", "analog", "pci"])) {
return isSink ? "bt-device-speaker" : "microphone";
}
if (props["device.bus"] === "bluetooth") return "bluetooth";
if (props["device.bus"] === "usb") return isSink ? "bt-device-speaker" : "microphone";
return isSink ? "volume" : "microphone";
}
}