[AGS] Bar progress

This commit is contained in:
2025-04-19 18:20:32 +02:00
parent 78e472beb8
commit b2f1d8fd9e
8 changed files with 249 additions and 107 deletions

View File

@@ -2,38 +2,24 @@ import { App } from "astal/gtk3"
import style from "./style.scss"
import notifications from "./components/notifications/handler";
import Bar from "./components/bar/ui/Bar";
App.start({
instanceName: "runner",
css: style,
main() {
notifications.startNotificationHandler( 0, App.get_monitors()[0] )
notifications.startNotificationHandler( 0, App.get_monitors()[0] );
// TODO: Monitor handling
Bar.Bar( App.get_monitors()[0] );
},
requestHandler(request, res) {
const args = request.trimStart().split( ' ' );
// Notifications
// Notifications (TODO: Handle the arguments in the components themselves)
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!' );
}
res( notifications.cliHandler( args ) );
} else if ( args[ 0 ] === 'bar' ) {
res( Bar.cliHandler( args ) );
}
},
})