diff --git a/config/astal/app.ts b/config/astal/app.ts
index df44317..11f5328 100644
--- a/config/astal/app.ts
+++ b/config/astal/app.ts
@@ -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 ) );
}
},
})
diff --git a/config/astal/components/bar/ui/Bar.tsx b/config/astal/components/bar/ui/Bar.tsx
index 97be98e..aa55679 100644
--- a/config/astal/components/bar/ui/Bar.tsx
+++ b/config/astal/components/bar/ui/Bar.tsx
@@ -1,23 +1,36 @@
-import { createQuickActionsMenu } from "./QuickActions";
-import { GLib } from "astal";
import { Astal, Gdk, Gtk } from "astal/gtk3";
+import Hyprland from "./modules/Hyprland";
+import Calendar from "./modules/Calendar";
+import QuickView from "./modules/QuickView";
const Bar = (gdkmonitor: Gdk.Monitor) => {
+ const { TOP, LEFT, RIGHT } = Astal.WindowAnchor;
return (
+ cssClasses={["Bar"]}
+ exclusivity={Astal.Exclusivity.EXCLUSIVE}
+ anchor={TOP | LEFT | RIGHT}>
-
+
+
+
-
-
-
-
+
+
+
+
);
}
-export default Bar;
+const cliHandler = ( args: string[] ): string => {
+ return 'Not implemented';
+}
+
+export default {
+ Bar,
+ cliHandler
+};
diff --git a/config/astal/components/bar/ui/modules/Calendar.tsx b/config/astal/components/bar/ui/modules/Calendar.tsx
index e69de29..aa4fc7d 100644
--- a/config/astal/components/bar/ui/modules/Calendar.tsx
+++ b/config/astal/components/bar/ui/modules/Calendar.tsx
@@ -0,0 +1,17 @@
+import { GLib, Variable } from "astal"
+
+const Time = ({ format = "%a, %e.%m %H:%M:%S" }) => {
+ const time = Variable("").poll(1000, () =>
+ GLib.DateTime.new_now_local().format(format)!)
+
+ return