summaryrefslogtreecommitdiff
path: root/.config/eww/wall.yuck
blob: a1365b4de8b1eff7d948a5af283c7348d80665b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; shamelessly stolen from https://www.reddit.com/r/unixporn/comments/1hpe0lv/cinnamon_making_my_working_space_less_boring_with/

(defpoll time :initial "" :interval "1s" `date '+%H:%M'`)
(defpoll date :initial "" :interval "60s" `date '+%B %d, %Y'`)
(defpoll netup :initial "0" :interval "2s" `ifstat -t2 | awk '$1 == "wlan0" { print $6 }' | format-bytes`)
(defpoll netdown :initial "0" :interval "2s" `ifstat -t2 | awk '$1 == "wlan0" { print $8 }' | format-bytes`)
(defpoll uptime :initial `{"d":0,"h":0,"m":0}` :interval "60s" `uptime-json`)

(defwindow wall
           :monitor 0
           :geometry (geometry :x "0"
                               :y "0"
                               :width "1920px"
                               :height "1080px"
                               :anchor "center")
           :stacking "bottom"
           :exclusive false
           :focusable false
  (box :orientation "v"
       :class "wall"
       :valign "start"
       :halign "start"
       :spacing 0
       :space-evenly false
    (label :class "time"        :halign "start" :text {time})
    (label :class "date"        :halign "start" :text {date})
    (label :class "uptime"      :halign "start" :text "Up ${uptime.d > 0 ? "${uptime.d} day${uptime.d != 1 ? "s" : ""}, " : ""}${uptime.h} hour${uptime.h != 1 ? "s" : ""}, ${uptime.m} minute${uptime.m != 1 ? "s" : ""}")
    (label :class "sysmon"      :halign "start" :text "System Monitor")
    (label :class "sysmon-item" :halign "start" :text "  ${round(EWW_CPU.avg, 0)}%")
    (label :class "sysmon-item" :halign "start" :text "  ${round(EWW_RAM.used_mem_perc, 0)}%")
    (label :class "sysmon-item" :halign "start" :text "󱘲  ${round(EWW_DISK["/"].used_perc, 0)}%")
    (label :class "sysmon-item" :halign "start" :text "󰳢  ${netup}/s")
    (label :class "sysmon-item" :halign "start" :text "󰳜  ${netdown}/s")))