diff --git a/config/astal/app.ts b/config/astal/app.ts
index d711b7c..6a02a3f 100644
--- a/config/astal/app.ts
+++ b/config/astal/app.ts
@@ -1,14 +1,14 @@
import { App } from "astal/gtk4"
import style from "./style.scss"
-import notifications from "./components/notifications/handler";
+// import notifications from "./components/notifications/handler";
import Bar from "./components/bar/ui/Bar";
App.start({
instanceName: "runner",
css: style,
main() {
- notifications.startNotificationHandler( App.get_monitors()[0] );
+ // notifications.startNotificationHandler( App.get_monitors()[0] );
// TODO: Monitor handling
Bar.Bar( App.get_monitors()[0] );
},
@@ -17,7 +17,8 @@ App.start({
// Notifications (TODO: Handle the arguments in the components themselves)
if ( args[ 0 ] === 'notifier' ) {
- res( notifications.cliHandler( args ) );
+ res( 'Not available here yet, run astal -i notifier ' + args[ 1 ] );
+ // 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 8970216..1f38694 100644
--- a/config/astal/components/bar/ui/Bar.tsx
+++ b/config/astal/components/bar/ui/Bar.tsx
@@ -3,40 +3,55 @@ import Hyprland from "./modules/Hyprland";
import Calendar from "./modules/Calendar";
import QuickView from "./modules/QuickView";
import SystemInfo from "./modules/SystemInfo";
+import { CenterBox } from "astal/gtk4/widget";
const Bar = (gdkmonitor: Gdk.Monitor) => {
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor;
return (
-
-
-
-
-
-
-
-
-
-
-
-
- }>
-
+
+
+
+
+
+ }
+ centerWidget={}
+ endWidget={
+
+
+
+
+ }
+ >
+ }
+ >
);
-}
+};
-const cliHandler = ( args: string[] ): string => {
- return 'Not implemented';
-}
+const cliHandler = (args: string[]): string => {
+ return "Not implemented";
+};
export default {
Bar,
- cliHandler
+ cliHandler,
};
diff --git a/config/astal/components/bar/ui/QuickActions/QuickActions.tsx b/config/astal/components/bar/ui/QuickActions/QuickActions.tsx
index 3bc681c..096af5f 100644
--- a/config/astal/components/bar/ui/QuickActions/QuickActions.tsx
+++ b/config/astal/components/bar/ui/QuickActions/QuickActions.tsx
@@ -1,6 +1,7 @@
import { Gtk } from "astal/gtk4"
-import Network from "./modules/Networking/Network";
import Power from "./modules/Power";
+import Audio from "./modules/Audio/Audio";
+import Bluetooth from "./modules/Bluetooth/Bluetooth";
const QuickActions = () => {
const popover = new Gtk.Popover( { cssClasses: [ 'quick-actions-popover' ] } );
@@ -12,9 +13,11 @@ const QuickActions = () => {
const createQuickActionMenu = () => {
- return
+ // TODO: For the future add WiFi / Networking back, for the time being remove, as unnecessary effort
+ return
-
+
+
}
diff --git a/config/astal/components/bar/ui/QuickActions/modules/Audio/Audio.tsx b/config/astal/components/bar/ui/QuickActions/modules/Audio/Audio.tsx
new file mode 100644
index 0000000..de5a95f
--- /dev/null
+++ b/config/astal/components/bar/ui/QuickActions/modules/Audio/Audio.tsx
@@ -0,0 +1,178 @@
+import { bind, Binding } from "astal";
+import { Gtk } from "astal/gtk4";
+import AstalWp from "gi://AstalWp";
+
+const wp = AstalWp.get_default()!;
+
+const AudioModule = () => {
+ const setVolumeSpeaker = (volume: number) => {
+ wp.defaultSpeaker.set_volume(volume / 100);
+ };
+
+ const setVolumeMicrophone = (volume: number) => {
+ wp.defaultMicrophone.set_volume(volume / 100);
+ };
+
+ const speakerSelector = SinkSelectPopover(AstalWp.MediaClass.AUDIO_SPEAKER);
+ const micSelector = SinkSelectPopover(AstalWp.MediaClass.AUDIO_MICROPHONE);
+
+ return (
+
+
+
+
+ 100 * v)}
+ max={100}
+ min={0}
+ step={1}
+ widthRequest={100}
+ onChangeValue={self => setVolumeSpeaker(self.value)}
+ >
+
+ }
+ onClicked={() => speakerSelector.popup()}
+ >
+
+
+
+
+ 100 * v,
+ )}
+ max={100}
+ min={0}
+ step={1}
+ widthRequest={100}
+ onChangeValue={self => setVolumeMicrophone(self.value)}
+ >
+
+ }
+ onClicked={() => micSelector.popup()}
+ >
+
+
+ );
+};
+
+const SinkPicker = (type: AstalWp.MediaClass) => {
+ const devices = bind(wp, "endpoints");
+
+ return (
+
+
+
+
+ {devices.as(d => {
+ return d.map(device => {
+ if (device.get_media_class() !== type) {
+ return ;
+ }
+ return (
+
+ );
+ });
+ })}
+
+
+ );
+};
+
+const SinkSelectPopover = (type: AstalWp.MediaClass) => {
+ const popover = new Gtk.Popover();
+
+ popover.set_child(SinkPicker(type));
+
+ return popover;
+};
+
+export default {
+ AudioModule,
+};
diff --git a/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Bluetooth.tsx b/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Bluetooth.tsx
index e69de29..a87e522 100644
--- a/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Bluetooth.tsx
+++ b/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Bluetooth.tsx
@@ -0,0 +1,153 @@
+import { bind } from "astal";
+import { Gtk } from "astal/gtk4";
+import AstalBluetooth from "gi://AstalBluetooth";
+import BTDevice from "./Device";
+
+const bt = AstalBluetooth.get_default();
+
+const BluetoothModule = () => {
+ return (
+
+
+
+ }
+ onClicked={() => openBTPicker()}
+ >
+
+ );
+};
+
+const openBTPicker = () => {
+ picker.popup();
+ try {
+ bt.adapter.start_discovery();
+ } catch (_) {}
+};
+
+const BluetoothPickerList = () => {
+ return (
+ bt.adapter.stop_discovery()}>
+
+
+
+ {bind(bt, "devices").as(devices => {
+ return devices
+ .filter(device => {
+ if (device.get_connected()) {
+ return device;
+ }
+ })
+ .map(device => {
+ return ;
+ });
+ })}
+
+
+
+
+
+ {bind(bt, "devices").as(devices => {
+ return devices
+ .filter(data => {
+ if (!data.get_connected()) {
+ return data;
+ }
+ })
+ .map(device => {
+ return ;
+ });
+ })}
+
+
+
+ );
+};
+
+
+
+const BluetoothPicker = () => {
+ const popover = new Gtk.Popover();
+
+ popover.set_child(BluetoothPickerList());
+ popover.connect( 'closed', () => bt.adapter.stop_discovery() );
+
+ return popover;
+};
+
+const picker = BluetoothPicker();
+
+export default {
+ BluetoothModule,
+};
diff --git a/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Device.tsx b/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Device.tsx
new file mode 100644
index 0000000..44b6256
--- /dev/null
+++ b/config/astal/components/bar/ui/QuickActions/modules/Bluetooth/Device.tsx
@@ -0,0 +1,52 @@
+import { bind } from "astal";
+import AstalBluetooth from "gi://AstalBluetooth";
+
+
+const BTDevice = ({ device }: { device: AstalBluetooth.Device }) => {
+ return (
+
+ );
+};
+
+
+export default BTDevice;
diff --git a/config/astal/components/bar/ui/QuickActions/modules/Brightness/Brightness.tsx b/config/astal/components/bar/ui/QuickActions/modules/Brightness/Brightness.tsx
new file mode 100644
index 0000000..e69de29
diff --git a/config/astal/components/bar/ui/QuickActions/modules/Networking/Network.tsx b/config/astal/components/bar/ui/QuickActions/modules/Networking/Network.tsx
index 20e38ef..9c018dd 100644
--- a/config/astal/components/bar/ui/QuickActions/modules/Networking/Network.tsx
+++ b/config/astal/components/bar/ui/QuickActions/modules/Networking/Network.tsx
@@ -73,7 +73,8 @@ const Network = () => {
} else {
return 'Unavailable';
}
- } )}>
+ } )} visible={bind(net.wifi, 'enabled').as( en => en )}>
+
}
>