nixos-configs/nixosModules/ags/v2/app.ts

79 lines
1.9 KiB
TypeScript
Raw Normal View History

import { App } from 'astal/gtk3';
2024-10-22 13:09:39 -04:00
import GLib from 'gi://GLib';
2024-10-22 00:14:39 -04:00
2024-09-27 12:37:14 -04:00
import style from './style.scss';
2024-10-18 00:44:45 -04:00
import AppLauncher from './widgets/applauncher/main';
2024-09-26 23:55:06 -04:00
import Bar from './widgets/bar/wim';
import BgFade from './widgets/bg-fade/main';
2024-10-21 16:35:20 -04:00
import Calendar from './widgets/date/main';
2024-10-12 16:48:23 -04:00
import Corners from './widgets/corners/main';
import IconBrowser from './widgets/icon-browser/main';
2024-10-16 22:33:15 -04:00
import { NotifPopups, NotifCenter } from './widgets/notifs/main';
import PowerMenu from './widgets/powermenu/main';
2024-10-28 14:45:10 -04:00
import Screenshot from './widgets/screenshot/main';
2024-10-29 00:11:37 -04:00
import { closeAll as closeAllFunc } from './lib';
import BrightnessService from './services/brightness';
2024-10-16 21:44:45 -04:00
import MonitorClicks from './services/monitor-clicks';
2024-10-22 00:14:39 -04:00
import Lockscreen from './widgets/lockscreen/main';
2024-10-29 00:11:37 -04:00
declare global {
function closeAll(): void;
// eslint-disable-next-line
var Brightness: typeof BrightnessService;
}
globalThis.closeAll = closeAllFunc;
globalThis.Brightness = BrightnessService;
2024-10-22 00:14:39 -04:00
const CONF = GLib.getenv('CONF');
switch (CONF) {
case 'lock': {
App.start({
css: style,
instanceName: CONF,
main: () => {
Lockscreen();
},
});
break;
}
case 'wim': {
App.start({
css: style,
2024-09-23 23:52:17 -04:00
2024-10-29 00:11:37 -04:00
requestHandler(js, res) {
App.eval(js).then(res).catch(res);
},
2024-10-22 00:14:39 -04:00
main: () => {
AppLauncher();
Bar();
BgFade();
Calendar();
Corners();
IconBrowser();
NotifPopups();
NotifCenter();
PowerMenu();
2024-10-28 14:45:10 -04:00
Screenshot();
2024-10-29 00:11:37 -04:00
Brightness.initService({
kbd: 'tpacpi::kbd_backlight',
caps: 'input1::capslock',
});
2024-10-22 00:14:39 -04:00
new MonitorClicks();
},
});
2024-10-16 21:44:45 -04:00
2024-10-22 00:14:39 -04:00
break;
}
}