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