eww rework, add battery
This commit is contained in:
parent
76c5b36e93
commit
c1c454612f
|
@ -45,3 +45,7 @@
|
|||
.current {
|
||||
color: #D65D0E;
|
||||
}
|
||||
|
||||
.battery, .ram, .disk {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
|
||||
(defwidget sidestuff []
|
||||
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
|
||||
(box :class "battery" :orientation "h" :space-evenly false
|
||||
{battery != "" ? " ${battery}" : ""})
|
||||
(box :class "ram" :orientation "h"
|
||||
" ${ram}%")
|
||||
(box :class "disk" :orientation "h"
|
||||
" ${disk}")
|
||||
(metric :label ""
|
||||
:value { volume * 100 }
|
||||
:onchange "VOL=$(bc -l <<<\"scale=2; {} / 100\") ; wpctl set-volume @DEFAULT_AUDIO_SINK@ $VOL")
|
||||
(metric :label ""
|
||||
:value {EWW_RAM.used_mem_perc}
|
||||
:onchange "")
|
||||
(metric :label ""
|
||||
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
|
||||
:onchange "")
|
||||
time))
|
||||
|
||||
(deflisten workspaces :initial "[]" "bash ~/.config/eww/scripts/get-workspaces")
|
||||
|
@ -61,6 +61,15 @@
|
|||
(defpoll volume :interval "1s"
|
||||
"scripts/getvol")
|
||||
|
||||
(defpoll battery :interval "1s"
|
||||
"upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}'")
|
||||
|
||||
(defpoll ram :interval "1s"
|
||||
"MEM=$(free | grep Mem | awk '{print $3/$2 * 100.0}') ; echo \${MEM%.*}")
|
||||
|
||||
(defpoll disk :interval "1s"
|
||||
"df | grep '/$' | awk '{print $5}'")
|
||||
|
||||
(defpoll time :interval "10s"
|
||||
"date '+%H:%M %F'")
|
||||
|
||||
|
|
Loading…
Reference in New Issue