updated waybar for laptop
This commit is contained in:
@@ -181,6 +181,39 @@
|
|||||||
"format": "{text}",
|
"format": "{text}",
|
||||||
"tooltip": true
|
"tooltip": true
|
||||||
},
|
},
|
||||||
|
// --- NEW: Mic (PipeWire/WirePlumber) ---
|
||||||
|
"custom/mic": {
|
||||||
|
"exec": "$HOME/.config/waybar/scripts/mic_status.sh",
|
||||||
|
"return-type": "json",
|
||||||
|
"interval": 2,
|
||||||
|
"on-click": "$HOME/.config/waybar/scripts/mic_toggle.sh",
|
||||||
|
"tooltip": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// --- NEW: Touchpad toggle ---
|
||||||
|
"custom/touchpad": {
|
||||||
|
"exec": "$HOME/.config/waybar/scripts/touchpad_status.sh",
|
||||||
|
"return-type": "json",
|
||||||
|
"interval": 5,
|
||||||
|
"on-click": "$HOME/.config/waybar/scripts/touchpad_toggle.sh",
|
||||||
|
"tooltip": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// --- NEW: Temperatures (built-in waybar temperature) ---
|
||||||
|
"temperature": {
|
||||||
|
"critical-threshold": 90,
|
||||||
|
"format": " {temperatureC}°C",
|
||||||
|
"hwmon-path": "/sys/class/thermal/thermal_zone0/temp",
|
||||||
|
"tooltip": true
|
||||||
|
},
|
||||||
|
|
||||||
|
// --- NEW: Backlight ---
|
||||||
|
"backlight": {
|
||||||
|
"format": " {percent}%",
|
||||||
|
"on-scroll-up": "brightnessctl set +5%",
|
||||||
|
"on-scroll-down": "brightnessctl set 5%-",
|
||||||
|
"tooltip": true
|
||||||
|
},
|
||||||
|
|
||||||
// Performance (same concept as desktop)
|
// Performance (same concept as desktop)
|
||||||
"custom/performance": {
|
"custom/performance": {
|
||||||
|
@@ -4,10 +4,12 @@
|
|||||||
"height": 32,
|
"height": 32,
|
||||||
"spacing": 8,
|
"spacing": 8,
|
||||||
|
|
||||||
"modules-left": ["hyprland/workspaces", "hyprland/window"],
|
"modules-left": ["hyprland/workspaces", "hyprland/window", "privacy"],
|
||||||
"modules-center": ["privacy", "mpris"],
|
"modules-center": [],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"group/sys",
|
"group/sys",
|
||||||
|
"custom/mic",
|
||||||
|
"temperature",
|
||||||
"network",
|
"network",
|
||||||
"backlight",
|
"backlight",
|
||||||
"custom/kbdlight",
|
"custom/kbdlight",
|
||||||
@@ -17,10 +19,7 @@
|
|||||||
"custom/bt",
|
"custom/bt",
|
||||||
"custom/airplane",
|
"custom/airplane",
|
||||||
"battery",
|
"battery",
|
||||||
"custom/batteryhealth",
|
"custom/touchpad",
|
||||||
"power-profiles-daemon",
|
|
||||||
"custom/performance",
|
|
||||||
"custom/hyprsunset",
|
|
||||||
"tray",
|
"tray",
|
||||||
"clock"
|
"clock"
|
||||||
],
|
],
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
"click-to-reveal": true,
|
"click-to-reveal": true,
|
||||||
"transition-left-to-right": false
|
"transition-left-to-right": false
|
||||||
},
|
},
|
||||||
"modules": ["custom/sys", "cpu", "memory", "custom/temps", "disk#root"]
|
"modules": ["custom/sys", "cpu", "memory", "custom/temps", "disk#root", "custom/batteryhealth", "power-profiles-daemon", "custom/performance", "custom/hyprsunset"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
.config/waybar/scripts/mic_status.sh
Executable file
12
.config/waybar/scripts/mic_status.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Prints JSON for Waybar showing mic muted/unmuted
|
||||||
|
set -euo pipefail
|
||||||
|
is_muted=$(wpctl get-mute @DEFAULT_AUDIO_SOURCE@ | awk '{print $2}')
|
||||||
|
vol=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | awk '{printf("%.0f", $2*100)}' || echo 0)
|
||||||
|
|
||||||
|
if [[ "$is_muted" == "true" ]]; then
|
||||||
|
echo '{"text":"","tooltip":"Mic: muted","class":"muted"}'
|
||||||
|
else
|
||||||
|
echo "{\"text\":\" ${vol}%\",\"tooltip\":\"Mic: ${vol}%\",\"class\":\"live\"}"
|
||||||
|
fi
|
||||||
|
|
4
.config/waybar/scripts/mic_toggle.sh
Executable file
4
.config/waybar/scripts/mic_toggle.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
||||||
|
|
14
.config/waybar/scripts/touchpad_status.sh
Executable file
14
.config/waybar/scripts/touchpad_status.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
dev="$(hyprctl -j devices | jq -r '.touchpads[0].name')"
|
||||||
|
if [[ -z "$dev" || "$dev" == "null" ]]; then
|
||||||
|
echo '{"text":"","tooltip":"No touchpad detected","class":"absent"}'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
state=$(hyprctl getoption "device:$dev:enabled" -j | jq -r '.int')
|
||||||
|
if [[ "$state" -eq 1 ]]; then
|
||||||
|
echo '{"text":"","tooltip":"Touchpad: enabled","class":"on"}'
|
||||||
|
else
|
||||||
|
echo '{"text":"","tooltip":"Touchpad: disabled","class":"off"}'
|
||||||
|
fi
|
||||||
|
|
14
.config/waybar/scripts/touchpad_toggle.sh
Executable file
14
.config/waybar/scripts/touchpad_toggle.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Toggles touchpad using Hyprland device keyword.
|
||||||
|
set -euo pipefail
|
||||||
|
dev="$(hyprctl -j devices | jq -r '.touchpads[0].name')"
|
||||||
|
[[ -z "$dev" || "$dev" == "null" ]] && exit 0
|
||||||
|
state=$(hyprctl getoption "device:$dev:enabled" -j | jq -r '.int')
|
||||||
|
if [[ "$state" -eq 1 ]]; then
|
||||||
|
hyprctl keyword "device:$dev:enabled" 0
|
||||||
|
notify-send -a waybar "Touchpad" "Disabled"
|
||||||
|
else
|
||||||
|
hyprctl keyword "device:$dev:enabled" 1
|
||||||
|
notify-send -a waybar "Touchpad" "Enabled"
|
||||||
|
fi
|
||||||
|
|
@@ -180,4 +180,12 @@ window#waybar.bar-hdmi .module {
|
|||||||
color: @warning_color;
|
color: @warning_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mic / Touchpad state tinting */
|
||||||
|
#custom-mic.muted { opacity: 0.6; }
|
||||||
|
#custom-touchpad.off { opacity: 0.6; }
|
||||||
|
#temperature.critical { color: #FFCC33; font-weight: 600; }
|
||||||
|
|
||||||
|
/* Backlight spacing */
|
||||||
|
#backlight { padding: 0 6px; border-right: 1px solid @border_main; }
|
||||||
|
#custom-mic, #custom-touchpad { padding: 0 6px; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user