add waybar component for microphone state
This commit is contained in:
8
bin/mic-state.sh
Executable file
8
bin/mic-state.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
state=$(pactl get-source-mute $(pactl get-default-source) | awk '{printf $2}')
|
||||||
|
|
||||||
|
result='{"text": "", "alt": "'
|
||||||
|
result+="$state\"}"
|
||||||
|
|
||||||
|
echo "$result"
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
"modules-right": [
|
"modules-right": [
|
||||||
"tray",
|
"tray",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
|
"custom/mic-state",
|
||||||
"sway/language",
|
"sway/language",
|
||||||
"network",
|
"network",
|
||||||
"backlight",
|
"backlight",
|
||||||
@@ -26,6 +27,16 @@
|
|||||||
"format-muted": "MUTE",
|
"format-muted": "MUTE",
|
||||||
"on-click": "pavucontrol"
|
"on-click": "pavucontrol"
|
||||||
},
|
},
|
||||||
|
"custom/mic-state": {
|
||||||
|
"exec": "~/dotfiles/bin/mic-state.sh",
|
||||||
|
"format": "{icon}",
|
||||||
|
"return-type": "json",
|
||||||
|
"restart-interval": 0,
|
||||||
|
"format-icons": {
|
||||||
|
"yes": "",
|
||||||
|
"no": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"sway/language": {
|
"sway/language": {
|
||||||
"tooltip": false
|
"tooltip": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -34,12 +34,14 @@ window#waybar {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#network {
|
#network,
|
||||||
|
#custom-mic-state {
|
||||||
font-family: "Font Awesome 6 Free Solid";
|
font-family: "Font Awesome 6 Free Solid";
|
||||||
}
|
}
|
||||||
|
|
||||||
#tray,
|
#tray,
|
||||||
#pulseaudio,
|
#pulseaudio,
|
||||||
|
#custom-mic-state,
|
||||||
#language,
|
#language,
|
||||||
#network,
|
#network,
|
||||||
#upower,
|
#upower,
|
||||||
|
|||||||
Reference in New Issue
Block a user