akrutzler / plasma-audio-device-switcher

Simple widget to change the default audio output device/sink.
https://store.kde.org/p/1195707
Other
20 stars 24 forks source link

Headphone Icon has been gone #18

Open Naginipython opened 1 year ago

Naginipython commented 1 year ago

Hello, I am using Manjaro KDE, Kernal 5.15.78 with DE being Plasma 5.26. I usually update my system apps with Manjaro's 'add/remove software' but about a month or 2 ago I downloaded and updated using KDE's 'Discover', and since then the icon for my headphone has disappeared. I am unaware if I did something else to mess with it, I don't believe its likely. I'm currently using Audio Device Switcher 0.3.0. Its odd, the 'HDMI / DisplayPort 3' monitor icon has stayed visible, but where the headphone icon used to be, it's now a smaller square (compared to the monitor icon). The headphones are: 'Analog Output (HyperX Cloud Flight Wireless headset Analog Stereo)'. If there is anything I should do to give more information, let me know

alihakkidemiral commented 1 year ago

i did all of them same icon, but it still doesn't change. left icon still empty. ~/.local/share/plasma/plasmoids/org.kde.plasma.audiodeviceswitcher/contents/ui/main.qml

    function iconNameFromPort(port, fallback) {
        if (port) {
            if (port.name.indexOf("speaker") !== -1) {
                return "channelmixer";
            } else if (port.name.indexOf("headphones") !== -1) {
                return "channelmixer";
            } else if (port.name.indexOf("hdmi") !== -1) {
                return "channelmixer";
            } else if (port.name.indexOf("mic") !== -1) {
                return "audio-input-microphone";
            } else if (port.name.indexOf("phone") !== -1) {
                return "channelmixer";
            }
        }
        return fallback;
    }
joestringer commented 1 year ago

I wonder if these checks need to convert the port name to lower case before the comparison to make sure that they match?

denilsonsa commented 9 months ago

Hi! I decided to rewrite the icon selection logic in my own fork. The new logic tries matching multiple fields against multiple rules, and tries picking up the best icon somehow. It works on my computer, I hope it works on most cases, but there will certainly be some corner-case that will need tweaking.