update eww perf widget

This commit is contained in:
primardj 2024-03-25 00:50:41 +00:00
parent 371f2cd91c
commit b191db5e6b
2 changed files with 291 additions and 226 deletions

View file

@ -7,46 +7,97 @@
}
.perf_box {
margin-left: 7px;
.proc_box {
margin-left: 4px;
margin-right: 4px;
}
.perf_bar {
/*color: #FFFFFF;*/
/*background: #1d2021;*/
margin: 5px;
margin: 3px 6px;
progress {
min-width: 17px;
min-width: 25px;
border-radius: 4px;
background: #ff5d00;
}
}
.perf_box {
margin-left: 8px;
margin-right: 4px;
}
.bat_bar {
margin: 3px;
margin: 3px 3px;
progress {
min-width: 13px;
min-width: 19px;
border-radius: 4px;
background: #ff9900;
}
}
.ram_bar {
margin: 3px;
margin: 3px 3px;
progress {
min-width: 13px;
min-width: 19px;
border-radius: 4px;
background: #ff8866;
}
}
.swap_bar {
margin: 3px;
margin: 3px 3px;
progress {
min-width: 13px;
min-width: 19px;
border-radius: 4px;
background: #444444;
}
}
.perf_label {
color: #FFA500;
margin-top: 3px;
padding: 5px 10px 5px 10px;
background: rgba(54,42,40,1.0);
border-radius: 10px;
}
.val_label {
color: #FFA500;
margin: 3px 0px 3px 4px;
padding: 5px 10px 5px 10px;
background: rgba(54,42,40,1.0);
border-radius: 10px;
}
.disks_box {
color: #FFA500;
margin: 3px 0px 3px 0px;
padding: 5px 10px 5px 10px;
background: rgba(54,42,40,1.0);
border-radius: 10px;
}
.disk_bar {
margin: 3px 3px;
background: rgba(45,21,20,1.0);
border-radius: 4px;
progress {
/*min-width: 10px;*/
border-radius: 4px;
background: #aacc44;
}
}

View file

@ -15,239 +15,253 @@
:initial "0"
`echo $(free | grep Swap | awk '{print $4/$2 * 100.0}') | cut -d '.' -f 1 `)
(defpoll all_disks :interval "1s"
:initial ""
`print_yuck_disks_mounted`)
;(defvar all_disks
; "(box :orientation 'v'
; (label :text 'Jaaj 1')
; (label :text 'Jaaj 2'))" )
(defwidget perf []
(box
:space-evenly false
:orientation "h"
:class "perf_bars"
:orientation "v"
(box
:space-evenly false
:orientation "v"
:orientation "h"
:class "perf_bars"
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:height 499
:orientation "h"
:class "proc_box"
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 50}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 75}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 100}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 125}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 150}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 175}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 200}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 225}"
:orientation "v"
:class "perf_bar"))
(label
:class "perf_label"
:text "${cpu_avg} %")
)
(box
:space-evenly true
:height 500
:orientation "h"
:class "proc_box"
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 25}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 50}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 75}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 100}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 125}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 150}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 175}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 200}"
:orientation "v"
:class "perf_bar")
(progress
:flipped true
:value "${(100 - cpu_avg) * 3.25 - 225}"
:orientation "v"
:class "perf_bar"))
(label
:class "val_label"
:text "${cpu_avg} %")
)
(box
:space-evenly true
:height 500
:orientation "v"
(box
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
:height 152
: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"
: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 "h"
:height 152
: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"
: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 "h"
:height 152
: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} %")
)
: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} %")
)
)
)
(literal :content all_disks)
)
)