aboutsummaryrefslogtreecommitdiff
path: root/ags/app.ts
blob: b485250ef75a837fd2ea72bbbfd9207f905ac50a (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
import { App } from "astal/gtk3"
import { exec } from "astal/process"

import Bar from "./widget/Bar"

function updateStyle() {
  App.reset_css()
  exec(`sass ./style.scss /tmp/style.css`)
  App.apply_css("/tmp/style.css")
}

App.start({
  requestHandler(request, res) {
    switch (request) {
      case "reload":
        updateStyle()
        res("style reloaded")
        break;
      default:
        res("unknown command")
        break;
    }
  },
  main() {
    updateStyle()
    App.get_monitors().map(Bar)
  },
})