i have to rework the bar... too full
This commit is contained in:
@@ -2,13 +2,12 @@
|
|||||||
{
|
{
|
||||||
"layer": "top",
|
"layer": "top",
|
||||||
"position": "top",
|
"position": "top",
|
||||||
"height": 40,
|
"height": 50,
|
||||||
"modules-left": ["hyprland/workspaces"],
|
"modules-left": ["hyprland/workspaces"],
|
||||||
"modules-center": [],
|
"modules-center": [],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"custom/bluetooth-audio",
|
"custom/bluetooth-audio",
|
||||||
"custom/pixelbuds_pro",
|
"custom/pixelbuds_pro",
|
||||||
"wireplumber",
|
|
||||||
"network",
|
"network",
|
||||||
"cpu",
|
"cpu",
|
||||||
"memory",
|
"memory",
|
||||||
@@ -16,6 +15,7 @@
|
|||||||
"custom/gpu-screen-recorder",
|
"custom/gpu-screen-recorder",
|
||||||
"custom/gamemode",
|
"custom/gamemode",
|
||||||
"tray",
|
"tray",
|
||||||
|
"wireplumber",
|
||||||
"clock"
|
"clock"
|
||||||
],
|
],
|
||||||
|
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
"tooltip-format": "{ifname} via {gwaddr}"
|
"tooltip-format": "{ifname} via {gwaddr}"
|
||||||
},
|
},
|
||||||
"wireplumber": {
|
"wireplumber": {
|
||||||
"format": "{volume}% {icon}",
|
"format": "{volume}% {icon}",
|
||||||
"format-muted": "--- ",
|
"format-muted": "{node_name} ",
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"headphone": "",
|
"headphone": "",
|
||||||
"hands-free": "",
|
"hands-free": "",
|
||||||
@@ -121,8 +121,8 @@
|
|||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"exec": "~/.config/waybar/scripts/pixelbuds_pro_control.sh",
|
"exec": "~/.config/waybar/scripts/pixelbuds_pro_control.sh",
|
||||||
"interval": 5,
|
"interval": 5,
|
||||||
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect",
|
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect",
|
||||||
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc"
|
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc"
|
||||||
},
|
},
|
||||||
"custom/audio-output": {
|
"custom/audio-output": {
|
||||||
"format": "{}",
|
"format": "{}",
|
||||||
|
@@ -109,7 +109,7 @@ if [ -n "$device_mac" ]; then
|
|||||||
device_name=$(bluetoothctl info "$device_mac" | rg "Alias:" | cut -d ' ' -f 2-)
|
device_name=$(bluetoothctl info "$device_mac" | rg "Alias:" | cut -d ' ' -f 2-)
|
||||||
# Output in Waybar's JSON format
|
# Output in Waybar's JSON format
|
||||||
tooltip=$(bt-audio-info $device_mac)
|
tooltip=$(bt-audio-info $device_mac)
|
||||||
echo "{\"text\": \"$device_name <span size='large'></span>\", \"tooltip\": \"$tooltip\"}"
|
echo "{\"text\": \"$device_name <span size='large'></span>\", \"tooltip\": \"$tooltip\"}"
|
||||||
else
|
else
|
||||||
# Output empty string when no device is connected
|
# Output empty string when no device is connected
|
||||||
echo "{}"
|
echo "{}"
|
||||||
|
@@ -7,7 +7,7 @@ MAC_ADDRESS="B4:23:A2:09:D3:53"
|
|||||||
|
|
||||||
not_connected() {
|
not_connected() {
|
||||||
printf "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Pixel Buds Pro 2 not connected\", \"class\": \"disconnected\"}\n"
|
printf "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Pixel Buds Pro 2 not connected\", \"class\": \"disconnected\"}\n"
|
||||||
exit 0
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function gets the current status and formats it for Waybar.
|
# This function gets the current status and formats it for Waybar.
|
||||||
@@ -27,7 +27,7 @@ get_status() {
|
|||||||
if ([[ "$left_bud" == "unknown" ]] && [[ "$right_bud" == "unknown" ]]) || \
|
if ([[ "$left_bud" == "unknown" ]] && [[ "$right_bud" == "unknown" ]]) || \
|
||||||
[[ -z "$left_bud" && -z "$right_bud" ]]; then
|
[[ -z "$left_bud" && -z "$right_bud" ]]; then
|
||||||
echo "{}"
|
echo "{}"
|
||||||
exit 0
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$left_bud" == "unknown" ]]; then
|
if [[ "$left_bud" == "unknown" ]]; then
|
||||||
@@ -67,6 +67,7 @@ get_status() {
|
|||||||
# --- FORMAT OUTPUT ---
|
# --- FORMAT OUTPUT ---
|
||||||
printf '{"text": "%s | %s | %s", "tooltip": "Pixel Buds Pro 2", "class": "%s"}\n' \
|
printf '{"text": "%s | %s | %s", "tooltip": "Pixel Buds Pro 2", "class": "%s"}\n' \
|
||||||
"$left_display" "$right_display" "$anc_icon" "$class"
|
"$left_display" "$right_display" "$anc_icon" "$class"
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
@@ -98,22 +99,28 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
pbpctrl set anc "$next_mode"
|
pbpctrl set anc "$next_mode"
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
exit
|
||||||
;;
|
;;
|
||||||
connect)
|
connect)
|
||||||
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
||||||
notify-send "Pixel Buds Pro 2 are already connected"
|
notify-send "Pixel Buds Pro 2 are already connected"
|
||||||
|
exit
|
||||||
else
|
else
|
||||||
bluetoothctl connect "$MAC_ADDRESS" & disown
|
bluetoothctl connect "$MAC_ADDRESS"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
disconnect)
|
disconnect)
|
||||||
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
||||||
bluetoothctl disconnect "$MAC_ADDRESS" & disown
|
bluetoothctl disconnect "$MAC_ADDRESS"
|
||||||
|
exit
|
||||||
else
|
else
|
||||||
notify-send "Pixel Buds Pro 2 aren't connected"
|
notify-send "Pixel Buds Pro 2 aren't connected"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
status
|
status
|
||||||
|
exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@@ -189,7 +189,7 @@ window#waybar.hidden {
|
|||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-audio-output, #wireplumber {
|
#clock, #custom-audio-output, #wireplumber {
|
||||||
color: @teal;
|
color: @teal;
|
||||||
border-bottom: 3px solid @teal;
|
border-bottom: 3px solid @teal;
|
||||||
}
|
}
|
||||||
@@ -198,10 +198,6 @@ window#waybar.hidden {
|
|||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock {
|
|
||||||
color: @teal;
|
|
||||||
}
|
|
||||||
|
|
||||||
tooltip {
|
tooltip {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
Reference in New Issue
Block a user