-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.tsx
More file actions
76 lines (69 loc) · 1.95 KB
/
Copy pathapp.tsx
File metadata and controls
76 lines (69 loc) · 1.95 KB
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
import init from "$lib/init"
import env from "$lib/env"
import app from "ags/gtk4/app"
import { createBinding, For, This } from "ags"
import { Bar } from "widget/Bar"
import { BarCorners } from "widget/Bar/components/BarCorners"
import { Power } from "widget/PowerMenu"
import { Settings } from "widget/Settings"
import { Launcher } from "widget/Bar/components/Launcher"
import { Notifications } from "widget/Bar/components/Notifications"
import { Battery } from "widget/Bar/components/Battery"
import { Workspaces } from "widget/Bar/components/Overview"
import { QuickSettings } from "widget/Bar/components/QuickSettings"
import { Network } from "widget/Bar/components/QuickSettings/components/Network"
import { Date } from "widget/Bar/components/Date"
import { OSD } from "widget/OSD"
import { scr } from "$lib/services"
app.start({
instanceName: env.appName,
main() {
const monitors = createBinding(app, "monitors");
init().catch(err => console.error("Init error:", err))
Date.Window()
Launcher.Window()
Power.Window()
Power.VerificationModal()
Notifications.Window()
Battery.Window()
Workspaces.Window()
QuickSettings.Window()
Network.Wifi.Window()
Settings.Window()
OSD()
return (
<For each={monitors}>
{(monitor) => (
<This this={app}>
<Bar gdkmonitor={monitor} />
<BarCorners gdkmonitor={monitor} />
</This>
)}
</For>
)
},
requestHandler(argv: string[], res: (response: string) => void) {
const [request] = argv
switch (request) {
case "shutdown":
Power.selAction("shutdown")
break;
case "record":
scr.recording ? scr.stopRecord() : scr.startRecord()
break;
case "record-area":
scr.recording ? scr.stopRecord() : scr.startRecord(true)
break;
case "screenshot":
scr.screenshot()
break;
case "screenshot-area":
scr.screenshot(true)
break;
default:
res(`Unknown request: ${request}`)
return;
}
res("Request handled successfully")
},
})