configure waybar

This commit is contained in:
0x1d
2025-08-18 16:41:55 +02:00
parent 2360d681f1
commit b05509b3a9

View File

@@ -195,83 +195,171 @@
# Create Waybar configuration # Create Waybar configuration
environment.etc."xdg/waybar/config".text = '' environment.etc."xdg/waybar/config".text = ''
{ {
"layer": "top", // "layer": "top", // Waybar at top layer
"position": "top", // "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, "height": 30, // Waybar height (to be removed for auto height)
"spacing": 4, // "width": 1280, // Waybar width
"modules-left": ["hyprland/workspaces"], "spacing": 4, // Gaps between modules (4px)
"modules-center": ["hyprland/window"], // Choose the order of the modules
"modules-right": ["battery", "pulseaudio", "network", "cpu", "memory", "clock", "tray"], "modules-left": ["hyprland/workspaces","hyprland/window", "hyprland/mode", "hyprland/scratchpad", "custom/media"],
"hyprland/workspaces": { //"modules-center": ["hyprland/window"],
"disable-scroll": true, "modules-right": ["pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"],
"all-outputs": true, // Modules configuration
"format": "{name}", // "hyprland/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "warp-on-scroll": false,
// "format": "{icon}",
// //"format": "{name}: {icon}",
// "format-icons": {
// "1": "",
// "2": "",
// "3": "",
// "4": "",
// "5": "",
// "urgent": "",
// "focused": "",
// "default": ""
// }
// },
"keyboard-state": {
"numlock": true,
"capslock": true,
"format": "{name} {icon}",
"format-icons": { "format-icons": {
"1": "1", "locked": "",
"2": "2", "unlocked": ""
"3": "3",
"4": "4",
"5": "5",
"urgent": "urgent"
} }
}, },
"hyprland/window": {
"format": "{}", "hyprland/mode": {
"max-length": 50 "format": "<span style=\"italic\">{}</span>"
}, },
"battery": { "hyprland/scratchpad": {
"states": { "format": "{icon} {count}",
"warning": 20, "show-empty": false,
"critical": 10 "format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) {songPosition}|{queueLength} {volume}% ",
"format-disconnected": "Disconnected ",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
"unknown-tag": "N/A",
"interval": 2,
"consume-icons": {
"on": " "
}, },
"format": "{icon} {capacity}%", "random-icons": {
"format-charging": " {capacity}%", "off": "<span color=\"#f53c3c\"></span> ",
"format-plugged": " {capacity}%", "on": " "
"format-alt": "{icon} {time}", },
"format-icons": ["", "", "", "", ""], "repeat-icons": {
"on-click": "powerprofilesctl" "on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
}, },
"clock": { "clock": {
"tooltip-format": "<big>{:%Y %B}</big>\\n<tt><small>{calendar}</small></tt>", // "timezone": "America/New_York",
"format": " {:%H:%M}", "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": " {:%Y-%m-%d %H:%M}" "format-alt": "{:%Y-%m-%d}"
}, },
"cpu": { "cpu": {
"format": " {usage}%", "format": "{usage}% ",
"format-icons": ["", "", "", "", ""],
"tooltip": false "tooltip": false
}, },
"memory": { "memory": {
"format": " {percentage}%", "format": "{}% "
"format-icons": ["", "", "", "", ""], },
"tooltip": false "temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", "", "", "", "", "", "", "", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-charging": "{capacity}% ",
"format-plugged": "{capacity}% ",
"format-alt": "{time} {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
}, },
"network": { "network": {
"format-wifi": " {essid}", // "interface": "wlp2*", // (Optional) To force the use of this interface
"format-ethernet": " {ipaddr}", "format-wifi": "{essid} ({signalStrength}%) ",
"format-disconnected": " Disconnected", "format-ethernet": "{ipaddr}/{cidr} ",
"format-icons": ["", "", "", "", ""], "tooltip-format": "{ifname} via {gwaddr} ",
"tooltip-format": "{ifname} via {gwaddr}", "format-linked": "{ifname} (No IP) ",
"max-length": 50 "format-disconnected": "Disconnected ",
"format-alt": "{ifname}: {ipaddr}/{cidr}"
}, },
"pulseaudio": { "pulseaudio": {
"format": " {volume}%", // "scroll-step": 1, // %, can be a float
"format-bluetooth": " {volume}% ", "format": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " ", "format-bluetooth": "{volume}% {icon} {format_source}",
"format-muted": " ", "format-bluetooth-muted": " {icon} {format_source}",
"format-muted": " {format_source}",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": { "format-icons": {
"headphone": "", "headphone": "",
"hands-free": "", "hands-free": "",
"headset": "", "headset": "",
"phone": "", "phone": "",
"portable": "", "portable": "",
"car": "", "car": "",
"default": ["", "", "", ""] "default": ["", "", ""]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
}, },
"tray": { "custom/media": {
"spacing": 10 "format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"format-icons": {
"spotify": "",
"default": "🎜"
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
} }
} }
''; '';