Added bluetooth menu.

This commit is contained in:
Jas Singh
2024-06-16 18:43:33 -07:00
parent 26d2fcde0e
commit 904c5b8cd0
18 changed files with 1376 additions and 182 deletions

View File

@@ -17,6 +17,16 @@ const Bluetooth = () => {
children: [btIcon, btText],
}),
isVisible: true,
props: {
on_primary_click: (_, event) => {
const clickPos = event.get_root_coords();
const coords = [clickPos[1], clickPos[2]];
globalMousePos.value = coords;
App.toggleWindow("bluetoothmenu");
},
},
};
}

View File

@@ -1,5 +1,7 @@
const network = await Service.import("network");
import { globalMousePos } from "../../../globals.js";
const Network = () => {
const wifiIndicator = [
Widget.Icon({
@@ -26,6 +28,17 @@ const Network = () => {
.as((w) => (w === "wired" ? wiredIndicator : wifiIndicator)),
}),
isVisible: true,
props: {
on_primary_click: (_, event) => {
console.log(JSON.stringify(network, null, 2));
const clickPos = event.get_root_coords();
const coords = [clickPos[1], clickPos[2]];
globalMousePos.value = coords;
App.toggleWindow("networkmenu");
},
},
};
};

View File

@@ -1,4 +1,3 @@
const hyprland = await Service.import("hyprland");
const audio = await Service.import("audio");
import { globalMousePos } from "../../../globals.js";
@@ -39,16 +38,14 @@ const Volume = () => {
}),
isVisible: true,
props: {
on_primary_click: (a, b, c, d) => {
const monX = hyprland.monitors[hyprland.active.monitor.id].x;
const monY = hyprland.monitors[hyprland.active.monitor.id].y;
on_primary_click: (_, event) => {
const clickPos = event.get_root_coords();
const coords = [clickPos[1], clickPos[2]];
const cursorPos = Utils.exec("hyprctl cursorpos").split(", ").map(Number);
cursorPos[0] = cursorPos[0] - monX;
cursorPos[1] = cursorPos[1] - monY;
globalMousePos.value = cursorPos;
App.toggleWindow("audiomenu");
},
globalMousePos.value = coords;
App.toggleWindow("audiomenu");
},
},
};
};