aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/panel/drives.yuck
blob: 122f0d81c77ecabd73689edce5d0b982ef579e81 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(defwidget dock-drives []
  (box
    :orientation "v"
    (disk
      :label "System"
      :mount "/"
      :space "100"
    )
    (disk
      :label "SSD 1"
      :mount "/mnt/ssd250"
      :space "250"
    )
    (disk
      :label "SSD 2"
      :mount "/mnt/games"
      :space "250"
    )
    (disk
      :label "HDD"
      :mount "/mnt/hdd500"
      :space "500"
    )
    (disk
      :label "RAID"
      :mount "/mnt/raid"
      :space "3000"
    )
  )
)

(defwidget disk [label mount space]
  (eventbox
    :class "disk-wrapper"
  (button
    :onclick "quick file ${mount}"
    (box
      :class "disk"
      :space-evenly false
      (box
        :class "disk-icon"
        :width 30
        (image :path "/home/edwin/workspace/icons/hard-drive.svg")
      )
      (box
        :class "disk-usage"
        :orientation "v"
        :spacing 3
        :space-evenly false
        (box
          :class "disk-usage-text"
          :width 140
          (box
            :halign "start"
            :valign "start"
            label
          )
          (box
            :halign "end"
            :valign "end"
            :hexpand true
            :vexpand true
            "${round(EWW_DISK[mount].free/1000000000, 0)} GB"
          )
        )
        (scale
          :class "disk-usage-bar"
          :marks "false"
          :max 100 
          :min 0
          :value {EWW_DISK[mount].used_perc}
        )
      )
    )
  )
  )
)