diff --git a/modules/wm/ags/default.nix b/modules/wm/ags/default.nix index 7cbae15..634abd1 100644 --- a/modules/wm/ags/default.nix +++ b/modules/wm/ags/default.nix @@ -30,6 +30,7 @@ in { # TODO: Find a way to add this for ags only covercolors brightnessctl + blueberry ]; # systemd.user.services.ags = { # Unit = { diff --git a/modules/wm/ags/misc/menu.js b/modules/wm/ags/misc/menu.js index cb3a595..0f945d5 100644 --- a/modules/wm/ags/misc/menu.js +++ b/modules/wm/ags/misc/menu.js @@ -168,11 +168,11 @@ export const Menu = ({ name, icon, title, content, ...props }) => ...props, }); -/** @param {{type: string} & import("../types/widgets/button").ButtonProps} props */ -export const SettingsButton = ({ type, ...props }) => +/** @param {{type?: string, command?: string} & import("../types/widgets/button").ButtonProps} props */ +export const SettingsButton = ({ type, command, ...props }) => Widget.Button({ onClicked: () => { - Utils.execAsync(`gnome-control-center ${type}`); + Utils.execAsync(command ?? `gnome-control-center ${type}`); App.closeWindow("quicksettings"); }, hexpand: true, diff --git a/modules/wm/ags/modules/bluetooth.js b/modules/wm/ags/modules/bluetooth.js index b6652f5..b9b9390 100644 --- a/modules/wm/ags/modules/bluetooth.js +++ b/modules/wm/ags/modules/bluetooth.js @@ -59,7 +59,7 @@ export const Selection = (props) => children: bluetooth.bind("devices").as((x) => x.map(DeviceItem)), }), Widget.Separator({ className: "accent" }), - SettingsButton({ type: "bluetooth" }), + SettingsButton({ command: "blueberry" }), ], ...props, }); @@ -70,11 +70,12 @@ const DeviceItem = (device) => children: [ Widget.Icon(`${device.icon_name}-symbolic`), Widget.Label(device.name), + Widget.Box({ hexpand: true }), Widget.Label({ label: `${device.battery_percentage}%`, + css: "padding-right: 24px;", visible: device.bind("battery_percentage").as((x) => x > 0), }), - Widget.Box({ hexpand: true }), Widget.Spinner({ active: device.bind("connecting"), visible: device.bind("connecting"), @@ -82,8 +83,8 @@ const DeviceItem = (device) => Widget.Switch({ active: device.bind("connected"), visible: device.bind("connecting").as((p) => !p), - // sensitive: false, setup: (self) => + // TODO: If connecting to the device failed, reset back the switch to `active: false`. self.connect("state_set", () => { device.setConnection(self.active); return true; diff --git a/modules/wm/ags/style.css b/modules/wm/ags/style.css index fcce45c..2eb60c8 100644 --- a/modules/wm/ags/style.css +++ b/modules/wm/ags/style.css @@ -88,7 +88,7 @@ mark { } switch { - background-color: #000; + background-color: #1E1E2E; border-radius: 100px; }