forked from Sinomor/delta-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.ts
More file actions
65 lines (64 loc) · 1.91 KB
/
Copy pathrequest.ts
File metadata and controls
65 lines (64 loc) · 1.91 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
import app from "ags/gtk4/app";
import ScreenRecorder from "./src/services/screenrecorder";
import { windows_names } from "./windows";
import { hasBarItem, toggleQsModule, toggleWindow } from "./src/lib/utils";
import { config } from "./options";
const screenrecorder = ScreenRecorder.get_default();
export default function request(
args: string[],
response: (res: string) => void,
): void {
if (args[0] == "toggle" && args[1]) {
switch (args[1]) {
case "applauncher":
toggleWindow(windows_names.applauncher);
break;
case "quicksettings":
toggleWindow(windows_names.quicksettings);
break;
case "calendar":
toggleWindow(windows_names.calendar);
break;
case "powermenu":
toggleWindow(windows_names.powermenu);
break;
case "clipboard":
toggleWindow(windows_names.clipboard);
break;
case "weather":
toggleQsModule("weather");
break;
case "notificationslist":
toggleQsModule("notificationslist");
break;
case "volume":
toggleQsModule("volume");
break;
case "network":
toggleQsModule("network");
break;
case "bluetooth":
toggleQsModule("bluetooth");
break;
case "power":
toggleQsModule("power", "battery");
break;
default:
print("Unknown request:", request);
return response("Unknown request");
break;
}
return response("ok");
} else {
switch (args[0]) {
case "screenrecord":
screenrecorder.start();
break;
default:
print("Unknown request:", request);
return response("Unknown request");
break;
}
return response("ok");
}
}