G-dH / custom-hot-corners-extended

A GNOME Shell Extension that allows you to give a function to any corner or edge of your monitors and expand your keyboard capabilities.
GNU General Public License v3.0
130 stars 19 forks source link

suggest : port display on OSD #101

Open rach-hu opened 4 months ago

rach-hu commented 4 months ago

Hello G-DH I suggest you add the volume output port display on OSD and thank you very much for the work you have done

here is the modification I made on action. js

// OSD let icons = ['audio-volume-muted-symbolic', 'audio-volume-low-symbolic', 'audio-volume-medium-symbolic', 'audio-volume-high-symbolic', 'audio-volume-overamplified-symbolic'];

    let n;
    if (sink.is_muted || volume <= 0) {
        n = 0;
    } else {
        n = Math.ceil(3 * volume / maxLevelNorm);
        if (n < 1)
            n = 1;
        else if (n > 3)
            n = 4;
    }

    const gicon = new Gio.ThemedIcon({ name: icons[n] });
    const level = volume / maxLevel * ampScale;
    const label = sink.get_port().human_port;
    Main.osdWindowManager.show(-1, gicon, label, level, ampScale);
}
G-dH commented 4 months ago

Thanks!