This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Systray icons: make kmix and audio volume control different

Tags: None
(comma "," separated)
Khym Chanur
Registered Member
Posts
22
Karma
0
OS
When I have both kmix and the default audio volume control applet in the Plasma system tray they both use the exact same icon. I can simply remember that kmix is on the left and volume control on the right, but I'd prefer to change the kmix icon while leaving the volume control icon alone.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
By my knowledge the Plasma System Tray is using the plasma theme when showing the KMix & plasma-pa icons

Image
audio.svgz from the Breeze Light theme

More of the plasma 5 theming: https://techbase.kde.org/Development/Tutorials/Plasma5

The Audio Volume plasma widget is using icons audio-volume-muted, audio-volume-low, audio-volume-medium and audio-volume-high. The icons can be edited at the /usr/share/plasma/plasmoids/org.kde.plasma.volume/contents/code/icon.js:

Code: Select all
/*
    Copyright 2014-2015 Harald Sitter <sitter@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) version 3, or any
    later version accepted by the membership of KDE e.V. (or its
    successor approved by the membership of KDE e.V.), which shall
    act as a proxy defined in Section 6 of version 3 of the license.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*/

function name(volume, muted) {
    // FIXME: hardcoded max value
    var split_base = 65536/3.0;
    var icon = null;
    if ((volume / split_base <= 0) || muted) {
        icon = "audio-volume-muted";
    } else if (volume / split_base <= 1) {
        icon = "audio-volume-low";
    } else if (volume / split_base <= 2) {
        icon = "audio-volume-medium";
    } else {
        icon = "audio-volume-high";
    }
    return icon;
}


i.e.

Changing at here:
Code: Select all
icon = "audio-volume-muted";

to
Code: Select all
icon = "/usr/share/plasma/plasmoids/org.kde.plasma.volume/contents/code/LocalIcons/matt-icons_audio-volume-muted.png";

etc...

Image

Restarting the plasmashell...and the the KMix and the pulse audio plasmoid are using different icons.

Image


Note !

Plasma (plasma-pa) upgrades will overwrite the icon.js.

This was with the Arch Linux & Plasma 5.6.4.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar