2024-11-01 18:16:43 -04:00
|
|
|
export default async() => {
|
|
|
|
const { execAsync } = await import('astal');
|
|
|
|
const { App } = await import('astal/gtk3');
|
|
|
|
|
|
|
|
const style = (await import('../style/main.scss')).default;
|
|
|
|
|
|
|
|
const AppLauncher = (await import('../widgets/applauncher/main')).default;
|
|
|
|
const Bar = (await import('../widgets/bar/wim')).default;
|
|
|
|
const BgFade = (await import('../widgets/bg-fade/main')).default;
|
2024-11-12 14:53:56 -05:00
|
|
|
const Calendar = (await import('../widgets/date/wim')).default;
|
2024-11-01 18:16:43 -04:00
|
|
|
const Clipboard = (await import('../widgets/clipboard/main')).default;
|
|
|
|
const Corners = (await import('../widgets/corners/main')).default;
|
|
|
|
const IconBrowser = (await import('../widgets/icon-browser/main')).default;
|
2024-11-12 14:53:56 -05:00
|
|
|
const { NotifPopups, NotifCenter } = await import('../widgets/notifs/wim');
|
2024-11-01 18:16:43 -04:00
|
|
|
const OSD = (await import('../widgets/osd/main')).default;
|
|
|
|
const PowerMenu = (await import('../widgets/powermenu/main')).default;
|
|
|
|
const Screenshot = (await import('../widgets/screenshot/main')).default;
|
|
|
|
|
|
|
|
const { closeAll } = await import('../lib');
|
|
|
|
const Brightness = (await import('../services/brightness')).default;
|
|
|
|
const MonitorClicks = (await import('../services/monitor-clicks')).default;
|
|
|
|
|
|
|
|
|
|
|
|
App.start({
|
|
|
|
css: style,
|
|
|
|
|
2024-11-07 10:39:28 -05:00
|
|
|
requestHandler(request, respond) {
|
|
|
|
if (request.startsWith('open')) {
|
|
|
|
App.get_window(request.replace('open ', ''))?.set_visible(true);
|
|
|
|
respond('window opened');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('closeAll')) {
|
|
|
|
closeAll();
|
|
|
|
respond('closed all windows');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('fetchCapsState')) {
|
|
|
|
Brightness.fetchCapsState();
|
|
|
|
respond('fetched caps_lock state');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('Brightness.screen')) {
|
|
|
|
Brightness.screen += parseFloat(request.replace('Brightness.screen ', ''));
|
|
|
|
respond('screen brightness changed');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('popup')) {
|
|
|
|
popup_osd(request.replace('popup ', ''));
|
|
|
|
respond('osd popped up');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('osk')) {
|
|
|
|
console.log(`TODO: ${request.replace('osk ', '')}`);
|
|
|
|
respond('implement this');
|
|
|
|
}
|
2024-11-01 18:16:43 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
main: () => {
|
2024-11-01 18:24:03 -04:00
|
|
|
execAsync('hyprpaper').catch(() => { /**/ });
|
2024-11-01 18:16:43 -04:00
|
|
|
|
|
|
|
AppLauncher();
|
|
|
|
Bar();
|
|
|
|
BgFade();
|
|
|
|
Calendar();
|
|
|
|
Clipboard();
|
|
|
|
Corners();
|
|
|
|
IconBrowser();
|
|
|
|
NotifPopups();
|
|
|
|
NotifCenter();
|
|
|
|
OSD();
|
|
|
|
PowerMenu();
|
|
|
|
Screenshot();
|
|
|
|
|
|
|
|
Brightness.initService({
|
|
|
|
kbd: 'tpacpi::kbd_backlight',
|
|
|
|
caps: 'input1::capslock',
|
|
|
|
});
|
|
|
|
new MonitorClicks();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|