aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/eww.yuck
blob: fb02c295e080f123c85a79306282887d864f3ce5 (plain) (blame)
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
(defwidget chad-widgets []
  (box :orientation "h"
    (sliders)))

(defwidget sliders []
  (box :class "master_vol" :orientation "v" :space-evenly false :halign "end"
    (metric :label ""
            :value master_vol
            :onchange "amixer set Master {}%")
      
    (metric :label ""
            :value head_vol
            :onchange "amixer set Headphone {}%")
  
    (chad :label "" 
             :value brightness
             :onchange "xbacklight -set {}%")
  )
)

(defwidget chad [label value onchange]
  (box :orientation "h"
       :class "chad"
       :space-evenly false
    (box :class "label" label)
    (scale :min 0
           :max 101
           :active {onchange != ""}
           :value value
           :onchange onchange)))

(defwidget metric [label value onchange]
  (box :orientation "h"
       :class "metric"
       :space-evenly false
    (box :class "label" label)
    (scale :min 0
           :max 101
           :active {onchange != ""}
           :value value
           :onchange onchange)))

(defpoll master_vol :interval "1s"
  "scripts/get_mastervol")

(defpoll head_vol :interval "1s"
  "scripts/get_headvol")

(defpoll brightness :interval "1s"
  "scripts/get_brightness")

(defwindow alsa-gui
  :monitor 0
  :windowtype "dock"
  :geometry (geometry :x "-01%"
                      :y "8%"
                      :width "5%"
                      :height "0px"
                      :anchor "top right")
  ; :reserve (struts :side "right" :distance "0%")
  (chad-widgets))