[AGS] Redo basic setup

This commit is contained in:
2025-04-19 15:20:50 +02:00
parent a9c7b7d7ee
commit 78e472beb8
18 changed files with 806 additions and 0 deletions

39
config/astal/app.ts Normal file
View File

@@ -0,0 +1,39 @@
import { App } from "astal/gtk3"
import style from "./style.scss"
import notifications from "./components/notifications/handler";
App.start({
instanceName: "runner",
css: style,
main() {
notifications.startNotificationHandler( 0, App.get_monitors()[0] )
},
requestHandler(request, res) {
const args = request.trimStart().split( ' ' );
// Notifications
if ( args[ 0 ] === 'notifier' ) {
if ( args[ 1 ] == 'show' ) {
notifications.openNotificationMenu( 0 );
res( 'Showing all open notifications' );
} else if ( args[ 1 ] == 'hide' ) {
notifications.closeNotificationMenu( 0 );
res( 'Hid all notifications' );
} else if ( args[ 1 ] == 'clear' ) {
notifications.clearAllNotifications( 0 );
res( 'Cleared all notifications' );
} else if ( args[ 1 ] == 'clear-newest' ) {
notifications.clearNewestNotifications( 0 );
res( 'Cleared newest notification' );
} else if ( args[ 1 ] == 'toggle' ) {
notifications.toggleNotificationMenu( 0 );
res( 'Toggled notifications' );
} else {
res( 'Unknown command!' );
}
} else if ( args[ 0 ] === 'bar' ) {
}
},
})