-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.ts
More file actions
40 lines (34 loc) · 1.29 KB
/
app.ts
File metadata and controls
40 lines (34 loc) · 1.29 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
import Gdk from "gi://Gdk?version=4.0"
import app from "ags/gtk4/app"
import requestHandler from "./requestHandler"
import { compileScss } from "@common/cssHotReload"
import * as vars from "@common/vars"
import Bar from "@windows/bar/Bar"
import LeftSidebar from "@windows/left_sidebar/LeftSidebar"
import RightSidebar from "@windows/right_sidebar/RightSidebar"
import OSD from "@windows/osd/OSD"
import NotificationPopups from "@windows/notification_popups/NotificationPopups"
import Crosshair from "@windows/crosshair/Crosshair"
import Launcher from "@windows/launcher/Launcher"
function getTargetMonitor(monitors: Array<Gdk.Monitor>) {
const notebookModel = "0x9051"
const pcModel = "24G2W1G4"
const notebookMonitor = monitors.find(m => m.model === notebookModel)
const pcMonitor = monitors.find(m => m.model === pcModel)
return notebookMonitor || pcMonitor || monitors[0]
}
app.start({
css: compileScss(),
requestHandler: requestHandler,
main() {
const targetMonitor = getTargetMonitor(app.get_monitors())
Bar(targetMonitor)
Launcher(targetMonitor)
LeftSidebar(targetMonitor)
RightSidebar(targetMonitor)
OSD(targetMonitor)
NotificationPopups(targetMonitor)
Crosshair(targetMonitor)
print(`\nAstal Windows applied on monitor: ${targetMonitor.model}`)
},
})