fix(waybar): mic icon centering and change to event-driven updating
This commit is contained in:
@@ -82,9 +82,10 @@
|
||||
},
|
||||
|
||||
"custom/micmute": {
|
||||
"exec": "bash -c 'wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED && echo \"\" || echo \"\"'",
|
||||
"interval": 1,
|
||||
"exec": "~/.config/waybar/scripts/micmute.sh",
|
||||
"interval": 0,
|
||||
"tooltip": true,
|
||||
"min-length": 2,
|
||||
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
}
|
||||
}
|
||||
|
||||
18
.config/waybar/scripts/micmute.sh
Executable file
18
.config/waybar/scripts/micmute.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
print_icon() {
|
||||
if wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED; then
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Print once on startup
|
||||
print_icon
|
||||
|
||||
# Subscribe to PipeWire events
|
||||
wpctl subscribe @DEFAULT_AUDIO_SOURCE@ | while read -r _; do
|
||||
print_icon
|
||||
done
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
/* --- Global Styles --- */
|
||||
* {
|
||||
font-family: 'SF Pro Text', 'Inter', 'Segoe UI, NotoSans Nerd Font', sans-serif;
|
||||
font-family: "JetBrainsMono Nerd Font Propo";
|
||||
font-size: 14px;
|
||||
min-height: 25px;
|
||||
padding-right: 0px;
|
||||
@@ -89,7 +89,8 @@
|
||||
#custom-power:hover,
|
||||
#pulseaudio:hover,
|
||||
#battery:hover,
|
||||
#tray:hover {
|
||||
#tray:hover,
|
||||
#custom-micmute:hover {
|
||||
background-color: @Buttonshover;
|
||||
}
|
||||
|
||||
@@ -107,17 +108,11 @@
|
||||
background-color: @Buttons;
|
||||
color: @Text;
|
||||
border-radius: 10px;
|
||||
padding: 0.5rem;
|
||||
margin: 5px;
|
||||
padding: 0.7rem;
|
||||
margin: 0.35rem;
|
||||
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
background-color: @Buttons;
|
||||
color: @Text;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
|
||||
#battery {
|
||||
color: @Text;
|
||||
|
||||
Reference in New Issue
Block a user