1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-24 20:01:49 +08:00

feat(waybar): Update waybar style

This commit is contained in:
Ryan 2024-03-02 19:28:34 +08:00
parent 4f00ca0bd5
commit 3415baa46e
3 changed files with 89 additions and 111 deletions

View File

@ -1,99 +0,0 @@
{
"layer": "top",
"modules-left": [
"hyprland/workspaces"
],
"fixed-center": false,
"modules-center": [
"hyprland/window"
],
"modules-right": [
"tray",
"custom/notification",
"custom/player",
"cpu",
"memory",
"network",
"battery",
"clock"
],
"hyprland/workspaces": {
"on-scroll-up": "hyprctl dispatch workspace e-1",
"on-scroll-down": "hyprctl dispatch workspace e+1",
"show_special": true,
"on-click": "activate",
"persistent_workspaces": {
"9": ["HDMI-A-1"]
}
},
"hyprland/window": {
"max-length": 50,
"separate-outputs": true
},
"tray": {
"spacing": 10
},
"cpu": {
"format": " {load}",
"format-alt": " {usage}% @ {avg_frequency}GHz"
},
"memory": {
"format": "󰍛 {used:0.1f}G / {total:0.1f}G",
"format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G"
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": "󰈀 {ifname}",
"format-linked": " {ifname}",
"format-disconnected": "󰌙 Disconnected",
"format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}",
"tooltip-format": "{ifname} via {gwaddr}"
},
"battery": {
"states": {
"good": 75,
"warning": 15,
"critical": 5
},
"format": "{icon} {capacity}%",
"format-charging": "🗲 {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} ETA: {time}",
"format-icons": [
"",
"",
"",
"",
""
]
},
"clock": {
"format": "{:󰅐 %H:%M\t %m-%d}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"custom/notification": {
"tooltip": true,
"format": "{icon}",
"format-icons": {
"notification": " <span foreground='red'><sup></sup></span> New notifications",
"none": " No notifications",
"dnd-notification": " DND on",
"dnd-none": " DND on"
},
"return-type": "json",
"exec-if": "which swaync-client",
"exec": "swaync-client -swb",
"on-click": "swaync-client -t -sw",
"on-click-right": "swaync-client -d -sw",
"escape": true
},
"custom/player": {
"format": "󰎈 {}",
"return-type": "json",
"exec": "playerctl -a metadata --format '{\"text\": \"{{uc(playerName)}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"class\": \"{{status}}\"}' -F",
"max-length": 35,
"on-click-middle": "playerctl play-pause",
"on-click-right": "plaerctl next",
"on-click-left": "playerctl previous"
}
}

View File

@ -3,9 +3,7 @@
*/
* {
border: none;
border-radius: 1px;
font-family: "IBM Plex Sans", "Symbols Nerd Font", sans-serif;
font-family: "IBM Plex Mono", "Symbols Nerd Font", sans-serif;
font-size: 14px;
min-height: 0;
}
@ -22,8 +20,12 @@ window#waybar {
margin: 5px 10px;
}
#window {
font-weight: bold;
}
#workspaces button {
padding: 0 2px;
padding: 0 0.1em;
background: transparent;
color: @background_b;
}
@ -51,11 +53,11 @@ window#waybar {
}
#clock {
color: @cyan;
color: @foreground;
}
#battery {
color: @blue;
color: @cyan;
}
#battery.charging {
@ -70,22 +72,25 @@ window#waybar {
}
#battery.warning:not(.charging) {
color: @background;
background-color: red;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-duration: 0.5s;
animation-iteration-count: infinite;
animation-name: blink;
animation-timing-function: linear;
background-color: red;
color: @background;
font-weight: bold;
}
#network.disconnected,
#network.disabled {
color: @red;
font-weight: bold;
}
#network.wifi {
color: @green;
font-style: italic;
}
#clock,

View File

@ -0,0 +1,72 @@
{
"sway/workspaces": {
"show_special": true,
"on-click": "activate"
},
"sway/window": {
"max-length": 50
},
"tray": {
"spacing": 10
},
"cpu": {
"format": " {load}",
"format-alt": " {usage}% @ {avg_frequency}GHz"
},
"memory": {
"format": "󰍛 {used:0.1f}G / {total:0.1f}G",
"format-alt": "󰓡 Swap: {swapUsed:0.1f}G / {swapTotal:0.1f}G"
},
"network": {
"format-wifi": " {essid} ({signalStrength}%)",
"format-ethernet": "󰈀 {ifname}",
"format-linked": " {ifname}",
"format-disconnected": "󰌙 Disconnected",
"format-alt": "󰩟 {ifname}: {ipaddr}/{cidr}",
"tooltip-format": "{ifname} via {gwaddr}"
},
"battery": {
"states": {
"good": 75,
"warning": 15,
"critical": 5
},
"format": "{icon} {capacity}%",
"format-charging": "󰉁 {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{icon} ETA: {time}",
"format-icons": ["", "", "", "", ""]
},
"clock": {
"format": "{:󰅐 %H:%M  %m-%d}",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
},
"custom/notification": {
"tooltip": true,
"format": "{icon}",
"format-icons": {
"notification": " <span foreground='red'><sup></sup></span> <span weight=\"bold\">Unread</span>",
"none": " <span style=\"italic\">Empty</span>",
"dnd-notification": " <span style=\"italic\">DND on</span>",
"dnd-none": " <span style=\"italic\">DND on</span>"
},
"return-type": "json",
"exec-if": "which swaync-client",
"exec": "swaync-client -swb",
"on-click": "swaync-client -t -sw",
"on-click-right": "swaync-client -d -sw",
"escape": true
},
"custom/player": {
"format": "{icon} <span style=\"italic\">{}</span>",
"format-icons": {
"Playing": "󰎈 ",
"Paused": "󰏤 "
},
"return-type": "json",
"exec": "playerctl -a metadata --format '{\"text\": \"{{playerName}}: {{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{markup_escape(title)}} - {{markup_escape(album)}}\", \"class\": \"{{status}}\", \"alt\": \"{{status}}\" }' -F",
"max-length": 40,
"on-click": "playerctl play-pause",
"on-click-right": "pavucontrol"
}
}