2024-11-19 23:55:17 -05:00
|
|
|
import { execAsync } from 'astal';
|
|
|
|
import { App } from 'astal/gtk3';
|
2024-11-12 15:08:13 -05:00
|
|
|
|
2024-11-19 23:55:17 -05:00
|
|
|
import style from '../style/main.scss';
|
2024-11-12 15:08:13 -05:00
|
|
|
|
2024-12-19 18:04:12 -05:00
|
|
|
import AppLauncher from '../widgets/applauncher';
|
2024-12-07 14:17:37 -05:00
|
|
|
import AudioWindow from '../widgets/audio/binto';
|
2024-11-19 23:55:17 -05:00
|
|
|
import Bar from '../widgets/bar/binto';
|
2024-12-19 18:04:12 -05:00
|
|
|
import BgLayer from '../widgets/bg-layer';
|
2024-11-19 23:55:17 -05:00
|
|
|
import Calendar from '../widgets/date/binto';
|
2024-12-19 18:04:12 -05:00
|
|
|
import Clipboard from '../widgets/clipboard';
|
2024-11-19 23:55:17 -05:00
|
|
|
import { NotifPopups, NotifCenter } from '../widgets/notifs/binto';
|
2024-12-19 18:04:12 -05:00
|
|
|
import OnScreenDisplay from '../widgets/on-screen-display';
|
|
|
|
import PowerMenu from '../widgets/powermenu';
|
|
|
|
import Screenshot from '../widgets/screenshot';
|
2024-11-12 15:08:13 -05:00
|
|
|
|
2024-11-19 23:55:17 -05:00
|
|
|
import { closeAll, perMonitor } from '../lib';
|
|
|
|
import Brightness from '../services/brightness';
|
2024-11-25 12:18:46 -05:00
|
|
|
import GpuScreenRecorder from '../services/gpu-screen-recorder';
|
2024-11-19 23:55:17 -05:00
|
|
|
import MonitorClicks from '../services/monitor-clicks';
|
2024-11-12 15:08:13 -05:00
|
|
|
|
|
|
|
|
2024-11-19 23:55:17 -05:00
|
|
|
export default () => {
|
2024-11-12 15:08:13 -05:00
|
|
|
App.start({
|
|
|
|
css: style,
|
|
|
|
|
|
|
|
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')) {
|
2024-11-20 23:38:41 -05:00
|
|
|
Brightness.get_default().fetchCapsState();
|
2024-11-12 15:08:13 -05:00
|
|
|
respond('fetched caps_lock state');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('popup')) {
|
|
|
|
popup_osd(request.replace('popup ', ''));
|
|
|
|
respond('osd popped up');
|
|
|
|
}
|
|
|
|
else if (request.startsWith('save-replay')) {
|
2024-11-25 12:18:46 -05:00
|
|
|
GpuScreenRecorder.get_default().saveReplay();
|
2024-11-12 15:08:13 -05:00
|
|
|
respond('saving replay');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
main: () => {
|
|
|
|
execAsync('hyprpaper').catch(() => { /**/ });
|
|
|
|
|
2024-11-18 10:40:40 -05:00
|
|
|
perMonitor((monitor) => BgLayer(monitor, false));
|
|
|
|
|
2024-11-12 15:08:13 -05:00
|
|
|
AppLauncher();
|
2024-12-07 14:17:37 -05:00
|
|
|
AudioWindow();
|
2024-11-12 15:08:13 -05:00
|
|
|
Bar();
|
|
|
|
Calendar();
|
|
|
|
Clipboard();
|
|
|
|
NotifPopups();
|
|
|
|
NotifCenter();
|
2024-11-25 12:18:46 -05:00
|
|
|
OnScreenDisplay();
|
2024-11-12 15:08:13 -05:00
|
|
|
PowerMenu();
|
|
|
|
Screenshot();
|
|
|
|
|
2024-11-20 23:38:41 -05:00
|
|
|
Brightness.get_default({ caps: 'input2::capslock' });
|
2024-11-25 12:18:46 -05:00
|
|
|
GpuScreenRecorder.get_default();
|
2024-11-20 23:38:41 -05:00
|
|
|
MonitorClicks.get_default();
|
2024-11-12 15:08:13 -05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|