Improved scaling

Размеры теперь в относительные единицах. Высота бара зависит от размера шрифта.
This commit is contained in:
DIvan2000 2024-12-05 15:48:16 +04:00
parent ecbd9a1a50
commit 6bcc57999b
2 changed files with 40 additions and 39 deletions

35
config
View File

@ -2,7 +2,7 @@
"reload_style_on_change": true, "reload_style_on_change": true,
"layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
"position": "top", // Waybar at the bottom of your screen "position": "top", // Waybar at the bottom of your screen
"height": 20, // Waybar height // Bar height is based on the css font size. Don't forget to change the tray icon size!
// "width": 1366, // Waybar width // "width": 1366, // Waybar width
// Choose the order of the modules // Choose the order of the modules
"modules-left": ["hyprland/workspaces", "tray", "hyprland/language"], "modules-left": ["hyprland/workspaces", "tray", "hyprland/language"],
@ -18,10 +18,11 @@
"disable-scroll": true, "disable-scroll": true,
"all-outputs": false, "all-outputs": false,
"active-only": false, "active-only": false,
"show-special": true,
"format": "{name}" "format": "{name}"
}, },
"tray": { "tray": {
// "icon-size": 21, "icon-size": 17,
"spacing": 10 "spacing": 10
}, },
"clock": { "clock": {
@ -43,10 +44,10 @@
} }
}, },
"cpu": { "cpu": {
"format": "{usage}% " "format": "{usage}%  "
}, },
"memory": { "memory": {
"format": "{}% " "format": "{}%  "
}, },
"battery": { "battery": {
"interval": 5, "interval": 5,
@ -58,27 +59,27 @@
"format": "{capacity}% {icon}", "format": "{capacity}% {icon}",
// "format-good": "", // An empty format will hide the module // "format-good": "", // An empty format will hide the module
// "format-full": "", // "format-full": "",
"format-icons": ["", "", "", "", ""] "format-icons": [" ", " ", " ", " ", " "]
}, },
"network": { "network": {
// "interface": "wlp2s0", // (Optional) To force the use of this interface // "interface": "wlp2s0", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ", "format-wifi": "{essid} ({signalStrength}%)  ",
"format-ethernet": "{ifname}: {ipaddr}/{cidr} ", "format-ethernet": "{ifname}: {ipaddr}/{cidr}  ",
"format-disconnected": "Disconnected ⚠" "format-disconnected": "Disconnected ⚠ "
}, },
"pulseaudio": { "pulseaudio": {
"scroll-step": 1, "scroll-step": 1,
"format": "{volume}% {icon}", "format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}", "format-bluetooth": "{volume}% {icon} ",
"format-muted": "", "format-muted": " ",
"format-icons": { "format-icons": {
"headphones": "", "headphones": " ",
"handsfree": "", "handsfree": " ",
"headset": "", "headset": " ",
"phone": "", "phone": " ",
"portable": "", "portable": " ",
"car": "", "car": " ",
"default": ["", ""] "default": [" ", " "]
}, },
"on-click": "pavucontrol" "on-click": "pavucontrol"
}, },

View File

@ -13,8 +13,8 @@
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: "Noto Nerd Font"; font-family: "Noto Nerd Font";
font-size: 13px; font-size: 17px;
min-height: 0; min-height: 1em;
} }
window#waybar { window#waybar {
@ -29,32 +29,32 @@ window#waybar {
.modules-left { .modules-left {
background: @base; background: @base;
border-radius: 10px; border-radius: 0.5em;
margin-left: -10px; margin-left: -0.5em;
padding: 0 10px; padding: 0 0.5em;
} }
.modules-right { .modules-right {
background: @base; background: @base;
border-radius: 10px; border-radius: 0.5em;
margin-right: -10px; margin-right: -0.5em;
padding: 0 10px; padding: 0 0.5em;
} }
.modules-center { .modules-center {
background: @base; background: @base;
border-radius: 10px; border-radius: 0.5em;
margin-right: 5px; margin-right: 0.25em;
margin-left: 5px; margin-left: 0.25em;
padding: 0 10px; padding: 0 0.5em;
} }
#power { #power {
background: @surface0; background: @surface0;
border-radius: 10px; border-radius: 0.5em;
margin-left: 2px; margin-left: 0.15em;
padding-right: 10px; padding-right: 0.5em;
margin-right: -10px; margin-right: -0.5em;
color: @red; color: @red;
} }
@ -72,7 +72,7 @@ window#waybar {
} }
#workspaces button { #workspaces button {
padding: 0 5px; padding: 0 0.25em;
background: transparent; background: transparent;
color: @text_color; color: @text_color;
border-top: 2px solid @surface0; border-top: 2px solid @surface0;
@ -95,16 +95,16 @@ window#waybar {
} }
#clock { #clock {
padding: 0 10px; padding: 0 0.5em;
margin: 0 1px; margin: 0 0.15em;
background: @surface0; background: @surface0;
border-radius: 5px; border-radius: 0.5em;
font-weight: bold; font-weight: bold;
} }
#language, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode { #language, #battery, #cpu, #memory, #network, #pulseaudio, #custom-spotify, #tray, #mode {
padding: 0 10px; padding: 0 0.15em;
margin: 0 1px; margin: 0 0.15em;
} }
#battery { #battery {