From bccadadf01887b149b05771d4d047a3f926513aa Mon Sep 17 00:00:00 2001 From: retrilzzy Date: Fri, 1 Nov 2024 22:31:18 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20waybar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Изменен порядок модулей - Добавлен модуль для монитора скорости сети - Оптимизированы стили --- Configs/waybar/config.jsonc | 53 ++++++++------ Configs/waybar/scripts/wifiinfo.sh | 20 +++--- Configs/waybar/styles.css | 107 ++++++++++------------------- Configs/waybar/theme.css | 2 +- 4 files changed, 79 insertions(+), 103 deletions(-) diff --git a/Configs/waybar/config.jsonc b/Configs/waybar/config.jsonc index d1aa093..40fbe5f 100644 --- a/Configs/waybar/config.jsonc +++ b/Configs/waybar/config.jsonc @@ -2,7 +2,7 @@ "layer": "top", "position": "top", "mode": "dock", - // "height": 28, // uncomment to set fixed height + "height": 24, // uncomment to set fixed height "exclusive": true, "passthrough": false, "gtk-layer-shell": true, @@ -10,7 +10,7 @@ // Positions "modules-left": [ - "custom/ws", // logo + "idle_inhibitor", "hyprland/workspaces", // workspaces @@ -18,14 +18,13 @@ ], "modules-center": [ + "custom/paddc", // padding "custom/cpuinfo", // temperature "memory", // memory "custom/cpu", // cpu - "idle_inhibitor", - "clock#time", // time "clock#date", // date @@ -34,6 +33,8 @@ ], "modules-right": [ + "network", // network speed + "tray", // tray "hyprland/language", // language @@ -48,11 +49,14 @@ ], // Modules - "custom/ws": { - "format": " ", - "tooltip": false, - "min-length": 3, - "max-length": 4 + "idle_inhibitor": { + "format": " -rzx.ovh", + "tooltip": true, + "tooltip-format-activated": "Presentation Mode", + "tooltip-format-deactivated": "Idle Mode", + "start-activated": false, + "max-length": 20, + "timeout": 5 }, "hyprland/workspaces": { @@ -166,15 +170,6 @@ "max-length": 6 }, - "idle_inhibitor": { - "format": "rzx.ovh", - "tooltip": true, - "tooltip-format-activated": "Presentation Mode", - "tooltip-format-deactivated": "Idle Mode", - "start-activated": false, - "timeout": 5 - }, - "clock#time": { "format": "󱑂 {:%H:%M}", "tooltip": true, @@ -203,11 +198,19 @@ "format": "{}", // in wifiinfo.sh, change "Wi-Fi" to "${essid}" to display network name "tooltip": true, "on-click": "~/.config/waybar/scripts/wifimenu.sh", - "interval": 1, + "interval": 2, "min-length": 7, "max-length": 7 }, + "network": { + "interface": "wlan0", + "interval": 2, + "format": " {bandwidthUpBytes}  {bandwidthDownBytes}", + "format-disconnected": "", + "max-length": 24 + }, + "tray": { "icon-size": 18, "rotate": 0, @@ -218,8 +221,8 @@ "format": "{}", "format-en": "EN", "format-ru": "RU", - "min-length": 5, - "max-length": 5 + "min-length": 4, + "max-length": 4 }, "pulseaudio": { @@ -258,9 +261,10 @@ "format": "{icon} {capacity}%", "format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"], "format-charging": "󱘖 {capacity}%", + "tooltip": true, "tooltip-format": "Time to Empty: {time}", "tooltip-format-charging": "Time to Full: {time}", - "interval": 1, + "interval": 2, "min-length": 6, "max-length": 6 }, @@ -271,6 +275,11 @@ "on-click": "~/.config/waybar/scripts/logoutlaunch.sh 2", "on-click-right": "~/.config/waybar/scripts/logoutlaunch.sh 1", "interval": 86400 + }, + + "custom/paddc": { + "format": " ", + "tooltip": false } } \ No newline at end of file diff --git a/Configs/waybar/scripts/wifiinfo.sh b/Configs/waybar/scripts/wifiinfo.sh index c3726a6..eb977ed 100755 --- a/Configs/waybar/scripts/wifiinfo.sh +++ b/Configs/waybar/scripts/wifiinfo.sh @@ -90,8 +90,8 @@ else # bssid="N/A" chan="N/A" # rssi="N/A" - rx_bitrate="" - tx_bitrate="" + # rx_bitrate="" + # tx_bitrate="" phy_mode="" signal=$(echo "$wifi_info" | awk -F: '{print $3}') @@ -119,10 +119,10 @@ else # rssi=$(echo "$iw_output" | grep "signal:" | awk '{print $2 " dBm"}') # Upload speed - rx_bitrate=$(echo "$iw_output" | grep "rx bitrate:" | awk '{print $3 " " $4}') + # rx_bitrate=$(echo "$iw_output" | grep "rx bitrate:" | awk '{print $3 " " $4}') # Download speed - tx_bitrate=$(echo "$iw_output" | grep "tx bitrate:" | awk '{print $3 " " $4}') + # tx_bitrate=$(echo "$iw_output" | grep "tx bitrate:" | awk '{print $3 " " $4}') # Physical Layer Mode if echo "$iw_output" | grep -E -q "rx bitrate:.* VHT"; then @@ -147,13 +147,13 @@ else # tooltip+="\nRSSI: ${rssi}" tooltip+="\nStrength: ${signal} / 100" - if [ -n "$rx_bitrate" ]; then - tooltip+="\nRx Rate: ${rx_bitrate}" - fi + # if [ -n "$rx_bitrate" ]; then + # tooltip+="\nRx Rate: ${rx_bitrate}" + # fi - if [ -n "$tx_bitrate" ]; then - tooltip+="\nTx Rate: ${tx_bitrate}" - fi + # if [ -n "$tx_bitrate" ]; then + # tooltip+="\nTx Rate: ${tx_bitrate}" + # fi if [ -n "$phy_mode" ]; then tooltip+="\nPHY Mode: ${phy_mode}" diff --git a/Configs/waybar/styles.css b/Configs/waybar/styles.css index 8ca7adc..e798532 100644 --- a/Configs/waybar/styles.css +++ b/Configs/waybar/styles.css @@ -15,6 +15,10 @@ window#waybar { background: transparent; } +window#waybar > box { + margin-top: 4px; +} + /* Tooltip Styling */ tooltip { color: @foreground; @@ -64,7 +68,7 @@ tooltip { } /* General Module Styling */ -#custom-ws, +#idle_inhibitor, #workspaces, #window, #custom-cpuinfo, @@ -72,117 +76,84 @@ tooltip { #custom-cpu, #clock, #custom-wifi, +#tray, +#network, +#language, #pulseaudio, #custom-backlight, #battery, #custom-power { opacity: 1; margin-bottom: 0px; - padding-right: 4px; - padding-left: 4px; + padding-right: 2px; + padding-left: 2px; + margin-right: 2px; + margin-left: 2px; + border-radius: 8px; text-shadow: 0px 0px 2px rgba(22, 22, 22, 0.8); } -/* Logo */ -#custom-ws { +/* Idle Inhibitor */ +#idle_inhibitor { background: @logo; - border-radius: 8px; - padding: 1px 0 0 3px; - margin: 0px; - margin-right: 2px; + margin-left: 10px; + padding-left: 8px; + padding-right: 8px; } /* Workspaces */ #workspaces { background: @workspaces; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Window Title */ #window { background: @window; - margin-left: 2px; padding-right: 10px; padding-left: 10px; - border-radius: 8px; } /* Temperature */ +#custom-paddc { + padding-right: 12px; +} + #custom-cpuinfo { background: @cpuinfo; - padding-left: 1px; - padding-right: 0px; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Memory */ #memory { background: @memory; - padding-left: 1px; - padding-right: 0px; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* CPU */ #custom-cpu { background: @cpu; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; -} - -/* Idle Inhibitor */ -#idle_inhibitor { - color: @foreground; - background: @idle_inhibitor; - font-size: 11pt; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; - padding-right: 5px; - padding-left: 5px; - text-shadow: 0px 0px 1.5px rgba(22, 22, 22, 1); } /* Time */ #clock.time { background: @time; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Date */ #clock.date { background: @date; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } +/* Wifi */ #custom-wifi { background: @wifi; padding-right: 6px; padding-left: 4px; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Tray */ #tray { - padding-right: 6px; - padding-left: 6px; + padding-right: 8px; + padding-left: 8px; background: @tray; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } #tray menu { @@ -203,36 +174,35 @@ tooltip { background-color: @hover; } +/* Network */ +#network { + background: @network; + padding-right: 8px; + padding-left: 8px; +} + /* Language */ #language { background: @language; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; + padding-right: 2px; + padding-left: 2px; } /* PulseAudio */ #pulseaudio { background: @pulseaudio; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Brightness */ #custom-backlight { background: @backlight; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; } /* Battery */ #battery { background: @battery; - margin-right: 2px; - margin-left: 2px; - border-radius: 8px; + padding-right: 6px; + padding-left: 6px; } #battery.warning { @@ -246,10 +216,7 @@ tooltip { /* Power Button */ #custom-power { background: @power; - color: @foreground; - border-radius: 10px; - margin-right: 4px; - margin-left: 2px; + margin-right: 6px; padding-right: 6px; padding-left: 9px; } diff --git a/Configs/waybar/theme.css b/Configs/waybar/theme.css index 58e4f75..c7cfe5d 100644 --- a/Configs/waybar/theme.css +++ b/Configs/waybar/theme.css @@ -19,11 +19,11 @@ @define-color cpuinfo rgba(30, 30, 30, 0.8); @define-color memory rgba(50, 50, 50, 0.8); @define-color cpu rgba(70, 70, 70, 0.8); -@define-color idle_inhibitor rgba(80, 80, 80, 0.8); @define-color time rgba(70, 70, 70, 0.8); @define-color date rgba(50, 50, 50, 0.8); @define-color wifi rgba(30, 30, 30, 0.8); @define-color tray rgba(40, 40, 40, 0.8); +@define-color network rgba(40, 40, 40, 0.8); @define-color language rgba(45, 45, 45, 0.8); @define-color pulseaudio rgba(50, 50, 50, 0.8); @define-color backlight rgba(50, 50, 50, 0.8);