random eww changes

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2023-01-27 22:49:05 +05:30
parent e732d5514d
commit 1626936630
7 changed files with 15 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
(include "bar/music.yuck")
(include "bar/workspaces.yuck")
(include "bar/hyprworkspaces.yuck")
(include "bar/system.yuck")
(defwidget bar []

View File

@@ -18,7 +18,7 @@ workspaces() {
list_workspaces
workspaces
hyprctl dispatch workspace $current
hyprctl dispatch workspace $current || true
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r event; do
case ${event%>>*} in

View File

@@ -10,5 +10,4 @@
(button
:class "${ws == workspace.current ? 'workspace-active' : 'workspace-inactive'}"
:onclick "hyprctl dispatch workspace ${ws}"
{ws <= 10 ? numerals[ws - 1] : ws }))
)))
{ws <= 10 ? numerals[ws - 1] : ws })))))

View File

@@ -101,9 +101,6 @@
(system_bright)
(system_temp)))
(defpoll system_cpu_freq :interval "2s" :initial "0"
"cat /proc/cpuinfo | awk '/cpu MHz/ { sum += $4; n++} END { if (n != 0) print sum / n; }'")
(defwidget system_metric [value class tooltip]
(box
:orientation "h"
@@ -126,8 +123,8 @@
:space-evenly false
(system_metric
:value {EWW_CPU.avg}
:tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}%${system_cpu_freq == '0' ? '' : '
CPU Freq: ${system_cpu_freq} MHz'}"
:tooltip "CPU Usage: ${round(EWW_CPU.avg, 2)}%
CPU Freq: ${EWW_CPU.cores[0].freq} MHz}"
:class "cpu")
(system_metric
:value {EWW_RAM.used_mem_perc}
@@ -141,7 +138,7 @@ Free %: ${round(100 - EWW_RAM.used_mem_perc, 2)}%"
:class "battery")
(system_metric
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024, 2)} GB
:tooltip "Free Disk: ${round(EWW_DISK['/'].free / 1024 / 1024 / 1024, 2)} GB
Free Disk %: ${round(EWW_DISK['/'].free / EWW_DISK['/'].total * 100, 2)}%"
:class "disk"))))