summaryrefslogtreecommitdiff
path: root/.config/eww/applauncher.yuck
blob: 8a483ac379fa4580a8a2fe8f22b629bc2a1eed03 (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
(deflisten applist :initial '[{"name":"true"}]' `./listapps.py query`)

(defwindow applauncher
           :monitor 0
           :geometry (geometry :x "50%"
                               :y "50%"
                               :width "500px"
                               :height "400px"
                               :anchor "center center")
           :stacking "fg"
           :exclusive false
           :focusable true
  (eventbox :onhoverlost `${EWW_CMD} close applauncher`
    (box :orientation "v"
         :space-evenly false
         :class "applauncher"
      (input :onchange `./listapps.py query {}`
             :onaccept `./listapps.py run ${applist[0].name} & ${EWW_CMD} close applauncher`
             :class "app-input")
      (scroll :class "applist"
              :vexpand true
              :vscroll true
              :hscroll false
        (box :orientation "v"
             :space-evenly false
          (for appdata in applist
            (app :appdata appdata)))))))

(defwidget app [appdata]
  (button :onclick `./listapps.py run ${appdata.name} & ${EWW_CMD} close applauncher`
          :halign "start"
          :hexpand true
          :class "app"
    (box :orientation "h"
         :hexpand true
      (label :text {appdata.name}))))