fixed waybar

This commit is contained in:
biscuit
2025-05-14 06:59:28 -05:00
parent 0a5a621c99
commit 4d979ce197
2 changed files with 263 additions and 177 deletions
+150 -121
View File
@@ -1,123 +1,152 @@
// -*- mode: json -*-
{ {
"layer": "top", "layer": "top",
"position": "bottom", "position": "top",
"height": 45,
"modules-left": [ "spacing": 0,
"sway/workspaces", "modules-left": [
"custom/right-arrow-dark" "hyprland/workspaces",
], "tray",
"modules-center": [ "custom/lock",
"custom/left-arrow-dark", "custom/reboot",
"clock#1", "custom/power",
"custom/left-arrow-light", "clock"
"custom/left-arrow-dark", ],
"clock#2", "modules-center": ["hyprland/window"],
"custom/right-arrow-dark", "modules-right": [
"custom/right-arrow-light", "network",
"clock#3", "battery",
"custom/right-arrow-dark" "bluetooth",
], "pulseaudio",
"modules-right": [ "backlight",
"custom/left-arrow-dark", "custom/temperature",
"pulseaudio", "memory",
"custom/left-arrow-light", "cpu"
"custom/left-arrow-dark", ],
"memory", "hyprland/workspaces": {
"custom/left-arrow-light", "disable-scroll": false,
"custom/left-arrow-dark", "all-outputs": true,
"cpu", "format": "{icon}",
"custom/left-arrow-light", "on-click": "activate",
"custom/left-arrow-dark", "persistent-workspaces": {
"battery", "*":[1,2,3,4,5,6,7]
"custom/left-arrow-light", },
"custom/left-arrow-dark", "format-icons":{
"disk", "1": "󰣇",
"custom/left-arrow-light", "2": "",
"custom/left-arrow-dark", "3": "",
"tray" "4": "󰇮",
], "5": "",
"6": "",
"custom/left-arrow-dark": { "7": "",
"format": "", "active": "󱓻"
"tooltip": false }
}, },
"custom/left-arrow-light": { "custom/lock": {
"format": "", "format": "",
"tooltip": false "on-click": "hyprlock",
}, "tooltip": true,
"custom/right-arrow-dark": { "tooltip-format": "锁屏"
"format": "", },
"tooltip": false "custom/reboot": {
}, "format": "  ",
"custom/right-arrow-light": { "on-click": "systemctl reboot",
"format": "", "tooltip": true,
"tooltip": false "tooltip-format": "重启"
}, },
"custom/power": {
"sway/workspaces": { "format": "  ",
"disable-scroll": true, "on-click": "systemctl poweroff",
"format": "{name}" "tooltip": true,
}, "tooltip-format": "关机"
},
"clock#1": { "network": {
"format": "{:%a}", "format-wifi": " 󰤨 {essid} ",
"tooltip": false "format-ethernet": " Wired ",
}, "tooltip-format": "<span color='#FF1493'> 󰅧 </span>{bandwidthUpBytes} <span color='#00BFFF'> 󰅢 </span>{bandwidthDownBytes}",
"clock#2": { "format-linked": " 󱘖 {ifname} (No IP) ",
"format": "{:%H:%M}", "format-disconnected": "  Disconnected ",
"tooltip": false "format-alt": " 󰤨 {signalStrength}% ",
}, "interval": 1
"clock#3": { },
"format": "{:%m-%d}", "battery": {
"tooltip": false "states": {
}, "warning": 30,
"critical": 15
"pulseaudio": { },
"format": "{icon} {volume:2}%", "format": " {icon} {capacity}% ",
"format-bluetooth": "{icon} {volume}%", "format-charging": " 󱐋{capacity}%",
"format-muted": "MUTE", "interval": 1,
"format-icons": { "format-icons": ["󰂎", "󰁼", "󰁿", "󰂁", "󰁹"],
"headphones": "", "tooltip": true
"default": [ },
"", "pulseaudio": {
"" "format": "{icon}{volume}% ",
] "format-muted": " 󰖁 0% ",
}, "format-icons": {
"scroll-step": 5, "headphone": "  ",
"on-click": "pamixer -t", "hands-free": "  ",
"on-click-right": "pavucontrol" "headset": "  ",
}, "phone": "  ",
"memory": { "portable": "  ",
"interval": 5, "car": "  ",
"format": "Mem {}%" "default": [
}, "  ",
"cpu": { "  ",
"interval": 5, "  "
"format": "CPU {usage:2}%" ]
}, },
"battery": { "on-click-right": "pavucontrol -t 3",
"states": { "on-click": "pactl -- set-sink-mute 0 toggle",
"good": 95, "tooltip": true,
"warning": 30, "tooltip-format": "当前系统声音: {volume}%"
"critical": 15 },
}, "custom/temperature": {
"format": "{icon} {capacity}%", "exec": "sensors | awk '/^Package id 0:/ {print int($4)}'",
"format-icons": [ "format": " {}°C ",
"", "interval": 5,
"", "tooltip": true,
"", "tooltip-format": "当前 CPU 温度: {}°C"
"", },
"" "memory": {
] "format": "  {used:0.1f}G/{total:0.1f}G ",
}, "tooltip": true,
"disk": { "tooltip-format": "当前内存占比: {used:0.2f}G/{total:0.2f}G"
"interval": 5, },
"format": "Disk {percentage_used:2}%", "cpu": {
"path": "/" "format": "  {usage}% ",
}, "tooltip": true
"tray": { },
"icon-size": 20 "clock": {
} "interval": 1,
"timezone": "Asia/Chengdu",
"format": "  {:%H:%M} ",
"tooltip": true,
"tooltip-format": "{:L%Y 年 %m 月 %d 日, %A}"
},
"tray": {
"icon-size": 17,
"spacing": 6
},
"backlight": {
"device": "intel_backlight",
"format": "{icon}{percent}% ",
"tooltip": true,
"tooltip-format": "当前屏幕亮度: {percent}%",
"format-icons": [
" 󰃞 ", // 暗 - 深灰
" 󰃝 ", // 中 - 灰
" 󰃟 ", // 亮 - 柠檬黄
" 󰃠 " // 最亮 - 金色
]
},
"bluetooth": {
"format": "  {status} ",
"format-connected": "  {device_alias} ",
"format-connected-battery": "  {device_alias}{device_battery_percentage}% ",
"tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}",
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%"
}
} }
+113 -56
View File
@@ -1,74 +1,131 @@
* { * {
font-size: 20px; font-family: "CaskaydiaCove Nerd Font", "Font Awesome 6 Free", "Font Awesome 6 Free Solid";
font-family: monospace; font-size: 16px;
border-radius: 0;
min-height: 0;
border: none;
font-weight: bold;
} }
window#waybar { #workspaces{
background: #292b2e; background-color: rgba(24,24,37,1.0);
color: #fdf6e3; border: none;
box-shadow: none;
} }
#custom-right-arrow-dark, #tray{
#custom-left-arrow-dark { margin: 6px 3px;
color: #1a1a1a; background-color: rgba(36, 36, 52, 1.0);
} padding: 6px 12px; /* 保持内部间距 */
#custom-right-arrow-light, border-radius: 6px;
#custom-left-arrow-light { border-width: 0px;
color: #292b2e;
background: #1a1a1a;
} }
#workspaces, #waybar {
#clock.1, background-color: #181825;
#clock.2, transition-property: background-color;
#clock.3, transition-duration: 0.5s;
}
#window,
#clock,
#custom-power,
#custom-reboot,
#bluetooth,
#battery,
#pulseaudio, #pulseaudio,
#backlight,
#custom-temperature,
#memory, #memory,
#cpu, #cpu,
#battery, #network,
#disk, #custom-lock{
#tray { border-radius: 4px;
background: #1a1a1a; margin: 6px 3px;
padding: 6px 12px;
background-color: #1e1e2e;
color: #181825;
}
#clock {
background-color: #89b4fa;
}
#custom-power{
background-color: #f38ba8;
}
#custom-reboot{
background-color: #a6e3a1;
}
#bluetooth{
background-color: #f9e2af;
}
#battery{
background-color: #cba6f7;
}
#pulseaudio{
background-color: #89dceb;
}
#backlight{
background-color: #a6a3a1;
}
#custom-temperature{
background-color: #74c7ec;
}
#memory{
background-color: #f7768e;
}
#cpu{
background-color: #f38ba8;
}
#network{
background-color: #fab387;
}
#custom-lock{
background-color: #94e2d5;
}
#window{
background-color: #74c7ec;
}
#waybar.hidden {
opacity: 0.5;
} }
#workspaces button { #workspaces button {
padding: 0 2px; all: initial;
color: #fdf6e3; /* Remove GTK theme values (waybar #1351) */
} min-width: 0;
#workspaces button.focused { /* Fix weird spacing in materia (waybar #450) */
color: #268bd2; box-shadow: inset 0 -3px transparent;
} /* Use box-shadow instead of border so the text isn't offset */
#workspaces button:hover { padding: 6px 18px;
box-shadow: inherit; margin: 6px 3px;
text-shadow: inherit; border-radius: 4px;
} background-color: rgba(36, 36, 52, 1.0);
#workspaces button:hover { color: #cdd6f4;
background: #1a1a1a;
border: #1a1a1a;
padding: 0 3px;
} }
#pulseaudio { #workspaces button.active {
color: #268bd2; color: #1e1e2e;
} background-color: #cdd6f4;
#memory {
color: #2aa198;
}
#cpu {
color: #6c71c4;
}
#battery {
color: #859900;
}
#disk {
color: #b58900;
} }
#clock, #workspaces button:hover {
#pulseaudio, box-shadow: inherit;
#memory, text-shadow: inherit;
#cpu, color: #1e1e2e;
#battery, background-color: #cdd6f4;
#disk { }
padding: 0 10px;
tooltip {
border-radius: 8px;
padding: 16px;
background-color: #131822;
color: #C0C0C0;
}
tooltip label {
padding: 5px;
background-color: #131822;
color: #C0C0C0;
} }