-
Notifications
You must be signed in to change notification settings - Fork 87
PluginMicrophone
Display microphone activity status with mute detection on macOS and Linux.
ON
MUTED
75%
| Property | Value |
|---|---|
| Platform | macOS, Linux |
| Dependencies | macOS: powerkit-microphone binary, Linux: pactl or amixer (optional) |
| Content Type | dynamic |
| Presence | conditional (hidden when inactive) |
This plugin uses a native macOS binary for efficient microphone status detection using CoreAudio APIs.
| Property | Value |
|---|---|
| Binary | bin/powerkit-microphone |
| Source | src/native/macos/powerkit-microphone.m |
| Frameworks | Foundation, CoreAudio, AudioToolbox |
The binary is downloaded automatically from GitHub Releases when you first enable this plugin on macOS. A confirmation dialog will ask if you want to download it.
cd src/native/macos && make powerkit-microphone
cp powerkit-microphone ../../bin/If the binary is not available and you decline the download, the plugin returns inactive state on macOS (no fallback method available).
The native binary provides:
- Active microphone usage detection (
-a) - Mute status detection (
-m) - Input volume level (
-v) - List all input devices (
-l)
# Add to your tmux configuration
set -g @powerkit_plugins "microphone"
# Reload tmux configuration
tmux source-file ~/.tmux.confset -g @powerkit_plugins "microphone"
# Display options
set -g @powerkit_plugin_microphone_show_volume "false"
# Icons
set -g @powerkit_plugin_microphone_icon ""
set -g @powerkit_plugin_microphone_icon_muted ""
# Cache
set -g @powerkit_plugin_microphone_cache_ttl "2"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_microphone_show_volume |
bool | false |
Show input volume level |
@powerkit_plugin_microphone_icon |
icon | `` | Microphone on icon |
@powerkit_plugin_microphone_icon_muted |
icon | `` | Microphone muted icon |
@powerkit_plugin_microphone_cache_ttl |
number | 2 |
Cache duration in seconds |
| State | Condition |
|---|---|
active |
Microphone is being used or available |
inactive |
Microphone not in use (plugin hidden) |
| Level | Condition |
|---|---|
ok |
Microphone active and unmuted |
warning |
Microphone active but muted |
info |
Microphone available but not in use |
| Context | Description |
|---|---|
muted |
Microphone is muted (volume = 0) |
unmuted |
Microphone is active and unmuted |
set -g @powerkit_plugins "microphone"set -g @powerkit_plugins "microphone"
set -g @powerkit_plugin_microphone_show_volume "true"set -g @powerkit_plugins "microphone"
set -g @powerkit_plugin_microphone_icon ""
set -g @powerkit_plugin_microphone_icon_muted ""set -g @powerkit_plugins "microphone"
set -g @powerkit_plugin_microphone_cache_ttl "1"Uses osascript to read input volume:
osascript -e "input volume of (get volume settings)"Detection:
- Volume = 0: Muted
- Volume > 0: Unmuted
The plugin always shows on macOS when input volume is available (simplified behavior).
Uses PulseAudio/PipeWire (via pactl) or ALSA (via amixer) to detect microphone status.
Detection methods:
- pactl: Check source outputs for active capture
-
lsof: Check
/dev/snd/*for capture devices - Process detection: Check for common mic-using processes (zoom, teams, discord, etc.)
Mute detection:
-
pactl:
pactl get-source-mute -
amixer:
amixer get Capture | grep [off]
| Condition | Output |
|---|---|
| Muted | MUTED |
| Active with volume display | 75% |
| Active without volume | ON |
| Inactive | (hidden) |
-
Check if osascript works:
osascript -e "input volume of (get volume settings)" -
Verify input device is configured:
- System Preferences > Sound > Input
- Select an input device
-
Test plugin directly:
POWERKIT_ROOT="/path/to/tmux-powerkit" ./bin/powerkit-plugin microphone
-
Check if pactl is available:
which pactl pactl list short sources
-
Verify microphone is active:
pactl list short source-outputs
-
Check for mic-using processes:
lsof /dev/snd/* | grep -E "pcmC[0-9]+D[0-9]+c"
-
Test plugin directly:
POWERKIT_ROOT="/path/to/tmux-powerkit" ./bin/powerkit-plugin microphone
macOS:
-
Check actual input volume:
osascript -e "input volume of (get volume settings)" -
Adjust input volume in System Preferences > Sound > Input
Linux:
-
Check mute status:
pactl get-source-mute @DEFAULT_SOURCE@
-
Unmute:
pactl set-source-mute @DEFAULT_SOURCE@ 0
The plugin checks for active capture in this order:
- PulseAudio source outputs (most reliable)
- lsof on audio devices (checks device access)
- Process names (checks known applications)
If none work, install pactl:
# Ubuntu/Debian
sudo apt install pulseaudio-utils
# Fedora
sudo dnf install pulseaudio-utils
# Arch
sudo pacman -S pulseaudioIf the plugin causes lag:
-
Increase cache TTL:
set -g @powerkit_plugin_microphone_cache_ttl "5"
-
Check if detection commands are slow:
time pactl list short source-outputs time lsof /dev/snd/*
- Cannot reliably detect actual microphone usage without SIP bypass
- Plugin shows whenever input volume is available
- No per-application usage detection
- Requires PulseAudio/PipeWire for best results
- ALSA-only systems have limited detection
- Process-based detection is approximate
Monitor mic status during calls:
set -g @powerkit_plugins "microphone,camera"Confirm mic is active and unmuted:
set -g @powerkit_plugins "microphone"
set -g @powerkit_plugin_microphone_show_volume "true"Quickly see if mic is in use:
set -g @powerkit_plugins "microphone,camera"- PluginCamera - Camera usage indicator
- PluginVolume - System volume control
- PluginAudiodevices - Audio output device