feat: mute button on Waybar

This commit is contained in:
2026-01-31 13:48:38 +00:00
parent 68129c5363
commit 2314f440b9
3 changed files with 11 additions and 5 deletions

View File

@@ -32,8 +32,6 @@ bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10 bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
# Scroll through existing workspaces with mainMod + scroll # Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1 bind = $mainMod, mouse_up, workspace, e-1
@@ -46,7 +44,7 @@ bindm = $mainMod, mouse:273, resizewindow
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle bindel = SUPER, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+ bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%- bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-

View File

@@ -15,6 +15,7 @@
"modules-right": [ "modules-right": [
"tray", "tray",
"pulseaudio", "pulseaudio",
"custom/micmute",
"battery", "battery",
"custom/power" "custom/power"
], ],
@@ -79,5 +80,12 @@
"tooltip": false, "tooltip": false,
"on-click": "wlogout" "on-click": "wlogout"
}, },
"custom/micmute": {
"exec": "bash -c 'wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED && echo \"\" || echo \"\"'",
"interval": 1,
"tooltip": true,
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
}
} }

View File

@@ -103,7 +103,7 @@
} }
#tray, #battery, #pulseaudio, #custom-power { #tray, #battery, #pulseaudio, #custom-power, #custom-micmute {
background-color: @Buttons; background-color: @Buttons;
color: @Text; color: @Text;
border-radius: 10px; border-radius: 10px;