dotfiles/dotconfig/eww/perf_widget/perf.yuck

284 lines
7.6 KiB
Text
Raw Normal View History

2024-03-15 15:05:00 +01:00
(defpoll cpu_avg :interval "0.5s"
:initial "0"
`cpu_calcul`)
(defpoll bat_avg :interval "0.5s"
:initial "0"
`cat /sys/class/power_supply/BAT1/capacity`)
(defpoll ram_avg :interval "0.5s"
:initial "0"
`echo $(free | grep Mem | awk '{print $7/$2 * 100.0}') | cut -d '.' -f 1 `)
(defpoll swap_avg :interval "0.5s"
:initial "0"
`echo $(free | grep Swap | awk '{print $4/$2 * 100.0}') | cut -d '.' -f 1 `)
2024-03-25 01:50:41 +01:00
(defpoll all_disks :interval "1s"
:initial ""
`print_yuck_disks_mounted`)
;(defvar all_disks
; "(box :orientation 'v'
; (label :text 'Jaaj 1')
; (label :text 'Jaaj 2'))" )
2024-03-15 15:05:00 +01:00
(defwidget perf []
(box
:space-evenly false
2024-03-25 01:50:41 +01:00
:orientation "v"
2024-03-15 15:05:00 +01:00
(box
:space-evenly false
2024-03-25 01:50:41 +01:00
:orientation "h"
:class "perf_bars"
2024-03-15 15:05:00 +01:00
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
2024-03-25 01:50:41 +01:00
:height 499
2024-03-15 15:05:00 +01:00
:orientation "h"
2024-03-25 01:50:41 +01:00
:class "proc_box"
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 25}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 50}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 75}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 100}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 125}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 150}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 175}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 200}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar")
2024-03-15 15:05:00 +01:00
(progress
:flipped true
2024-03-25 01:50:41 +01:00
:value "${(100 - cpu_avg) * 3.25 - 225}"
2024-03-15 15:05:00 +01:00
:orientation "v"
2024-03-25 01:50:41 +01:00
:class "perf_bar"))
2024-03-15 15:05:00 +01:00
(label
2024-03-25 01:50:41 +01:00
:class "perf_label"
2024-08-03 13:18:47 +02:00
:text "${round(cpu_avg,0)} %")
2024-03-15 15:05:00 +01:00
)
(box
2024-03-25 01:50:41 +01:00
:space-evenly true
:height 500
2024-03-15 15:05:00 +01:00
:orientation "v"
(box
:space-evenly false
2024-03-25 01:50:41 +01:00
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 143
:class "perf_box"
(progress
:flipped true
:value "${bat_avg * 2.75}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 25}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 50}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 75}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 100}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 125}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 150}"
:orientation "v"
:class "bat_bar")
(progress
:flipped true
:value "${bat_avg * 2.75 - 175}"
:orientation "v"
:class "bat_bar")
)
(label
:class "val_label"
:text "${bat_avg} %")
)
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 143
:class "perf_box"
(progress
:flipped true
:value "${ram_avg * 2.75}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 25}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 50}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 75}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 100}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 125}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 150}"
:orientation "v"
:class "ram_bar")
(progress
:flipped true
:value "${ram_avg * 2.75 - 175}"
:orientation "v"
:class "ram_bar")
)
(label
:class "val_label"
:text "${100 - ram_avg} %")
)
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 143
:class "perf_box"
(progress
:flipped true
:value "${swap_avg * 2.75}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 25}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 50}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 75}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 100}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 125}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 150}"
:orientation "v"
:class "swap_bar")
(progress
:flipped true
:value "${swap_avg * 2.75 - 175}"
:orientation "v"
:class "swap_bar")
)
(label
:class "val_label"
:text "${100 - swap_avg} %")
)
2024-03-15 15:05:00 +01:00
2024-03-25 01:50:41 +01:00
)
2024-03-15 15:05:00 +01:00
)
2024-08-03 13:18:47 +02:00
;(literal :content all_disks)
2024-03-15 15:05:00 +01:00
)
)
(defwindow perf
:monitor 0
:geometry (geometry
:x "5%"
:y "8%"
:height "500px"
:anchor "top left")
:stacking "bg"
:exclusive true
:focusable false
:namespaces "perf_widget"
(perf))