- Little script I made that shows if my mic is muted or not for the KDE/Plasma command output widget.
This script assumes you are on Ubuntu 22.04.2, and use Pulseaudio/alsa. Any other configurations may or may not work, I have not tested them and won't be providing support for them.
- For Ubuntu the package is
fonts-font-awesome
but it may vary depending on your Linux distribution (if it's not that you will have to search around).
To add an action for when you left-click the command output widget to toggle mute for the mic, put this in a file and name it togglemicmute.sh
#/usr/bin/env bash
#toggle mic muted/unmuted state
qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "mic_mute"
Then add it in the command output configuration for the on click action by calling the script via this line
/bin/bash /locationofscript/togglemicmute.sh
- Credit for Mute status check logic is from this askUbuntu comment posted by "pragman".
- Credit for if statement null value checking is from this Unix StackExchange comment posted by "terdon".
- Credit for getting colors to work with
printf
(which also allowed fontawesome icons to display as an added bonus) is from this StackOverflow comment posted by "Vlad".