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 { .proc_box {
margin-left: 7px; margin-left: 4px;
margin-right: 4px;
} }
.perf_bar { .perf_bar {
/*color: #FFFFFF;*/ /*color: #FFFFFF;*/
/*background: #1d2021;*/ /*background: #1d2021;*/
margin: 5px; margin: 3px 6px;
progress { progress {
min-width: 17px; min-width: 25px;
border-radius: 4px;
background: #ff5d00; background: #ff5d00;
} }
} }
.perf_box {
margin-left: 8px;
margin-right: 4px;
}
.bat_bar { .bat_bar {
margin: 3px; margin: 3px 3px;
progress { progress {
min-width: 13px; min-width: 19px;
border-radius: 4px;
background: #ff9900; background: #ff9900;
} }
} }
.ram_bar { .ram_bar {
margin: 3px; margin: 3px 3px;
progress { progress {
min-width: 13px; min-width: 19px;
border-radius: 4px;
background: #ff8866; background: #ff8866;
} }
} }
.swap_bar { .swap_bar {
margin: 3px; margin: 3px 3px;
progress { progress {
min-width: 13px; min-width: 19px;
border-radius: 4px;
background: #444444; 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" :initial "0"
`echo $(free | grep Swap | awk '{print $4/$2 * 100.0}') | cut -d '.' -f 1 `) `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 [] (defwidget perf []
(box (box
:space-evenly false :space-evenly false
:orientation "h" :orientation "v"
:class "perf_bars"
(box (box
:space-evenly false :space-evenly false
:orientation "v" :orientation "h"
:class "perf_bars"
(box (box
:space-evenly false :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 :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" :orientation "v"
(box (box
:space-evenly false :space-evenly false
:orientation "h" :orientation "v"
:height 152 (box
:class "perf_box" :space-evenly false
(progress :orientation "h"
:flipped true :height 143
:value "${bat_avg * 2.75}" :class "perf_box"
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 25}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 25}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 50}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 50}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 75}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 75}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 100}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 100}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 125}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 125}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 150}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
(progress :value "${bat_avg * 2.75 - 150}"
:flipped true :orientation "v"
:value "${bat_avg * 2.75 - 175}" :class "bat_bar")
:orientation "v" (progress
:class "bat_bar") :flipped true
) :value "${bat_avg * 2.75 - 175}"
(label :orientation "v"
:class "val_label" :class "bat_bar")
:text "${bat_avg} %") )
) (label
(box :class "val_label"
:space-evenly false :text "${bat_avg} %")
:orientation "v" )
(box (box
:space-evenly false :space-evenly false
:orientation "h" :orientation "v"
:height 152 (box
:class "perf_box" :space-evenly false
(progress :orientation "h"
:flipped true :height 143
:value "${ram_avg * 2.75}" :class "perf_box"
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 25}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 25}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 50}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 50}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 75}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 75}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 100}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 100}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 125}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 125}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 150}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
(progress :value "${ram_avg * 2.75 - 150}"
:flipped true :orientation "v"
:value "${ram_avg * 2.75 - 175}" :class "ram_bar")
:orientation "v" (progress
:class "ram_bar") :flipped true
) :value "${ram_avg * 2.75 - 175}"
(label :orientation "v"
:class "val_label" :class "ram_bar")
:text "${100 - ram_avg} %") )
) (label
(box :class "val_label"
:space-evenly false :text "${100 - ram_avg} %")
:orientation "v" )
(box (box
:space-evenly false :space-evenly false
:orientation "h" :orientation "v"
:height 152 (box
:class "perf_box" :space-evenly false
(progress :orientation "h"
:flipped true :height 143
:value "${swap_avg * 2.75}" :class "perf_box"
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 25}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 25}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 50}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 50}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 75}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 75}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 100}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 100}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 125}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 125}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 150}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
(progress :value "${swap_avg * 2.75 - 150}"
:flipped true :orientation "v"
:value "${swap_avg * 2.75 - 175}" :class "swap_bar")
:orientation "v" (progress
:class "swap_bar") :flipped true
) :value "${swap_avg * 2.75 - 175}"
(label :orientation "v"
:class "val_label" :class "swap_bar")
:text "${100 - swap_avg} %") )
) (label
:class "val_label"
:text "${100 - swap_avg} %")
)
)
) )
(literal :content all_disks)
) )
) )