-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.tsx
120 lines (113 loc) · 3.12 KB
/
app.tsx
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/gjs -m
import "./globals"
import { App, Gdk } from "astal/gtk3";
import monitorStyle from "./cssHotLoad";
import PopupWindow from "modules/lib/popupwindow";
monitorStyle;
// import {
// Bar,
// cliphist,
// Dashboard,
// Launcherflowbox,
// Launchergrid,
// MediaPlayerWindow,
// NotificationPopups,
// // Overview,
// sessioncontrol,
// SystemStats,
// wallpapers,
// } from "./modules/Windows/index";
import windows from "./modules/Windows/index";
// const monitorID = Gdk.Display.get_default()!.get_n_monitors() - 1
App.start({
requestHandler(request: string, res: (response: any) => void) {
for (const monitor of App.get_monitors()) {
if (request == "dashboard") {
const win = App.get_window(`dashboard${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Hiding Dashboard");
} else if (win && !win.visible) {
win.visible = true;
res("Showing Dashboard");
}
}
if (request == "cliphist") {
const win = App.get_window(`cliphist${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Hiding Cliphist");
} else if (win && !win.visible) {
win.visible = true
res("Showing Cliphist");
}
}
if (request == "wallpapers") {
const win = App.get_window(`wallpapers${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Showing Wallpapers");
} else if (win && !win.visible) {
win.visible = true
res("Hiding Wallpapers");
}
}
if (request == "mediaplayerwindow") {
const win = App.get_window(`mediaplayerwindow${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Showing mediaplayerwindow");
} else if (win && !win.visible) {
win.visible = true;
res("Hiding mediaplayerwindow");
}
}
if (request == "sessioncontrols") {
const win = App.get_window(`sessioncontrols${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Showing sessioncontrol");
} else if (win && !win.visible) {
win.visible = true;
res("Hiding sessioncontrol");
}
}
if (request == "systemstats") {
const win = App.get_window(`systemstats${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Showing systemstats");
} else if (win && !win.visible) {
win.visible = true;
res("Hiding systemstats");
}
}
if (request == "launcher") {
const win = App.get_window(`launcher${monitor.get_model()}`)
if (win && win.visible) {
win.visible = false;
res("Showing Launcher");
} else if (win && !win.visible) {
win.visible = true;
res("Hiding Launcher");
}
}
}
},
main() {
for (const monitor of App.get_monitors()) {
windows.forEach((window) => window(monitor));
// Bar(monitor);
// cliphist(monitor);
// Dashboard(monitor);
// // Launcherflowbox(monitor);
// Launchergrid(monitor);
// MediaPlayerWindow();
// NotificationPopups(monitor);
// sessioncontrol(monitor);
// SystemStats(monitor);
// wallpapers(monitor);
}
},
});
// App.get_monitors().map(Bar)