Probably gonna abandon the QuickActions, as that is just way too much effort for what it does. Will be providing keybinds for doing what I wanted to do there in Hyprland
32 lines
967 B
TypeScript
32 lines
967 B
TypeScript
import { Astal, App } from "astal/gtk4";
|
|
import PowerProfiles from "gi://AstalPowerProfiles";
|
|
import { Variable } from "astal";
|
|
import { Sliders } from "./modules/Sliders";
|
|
import { Toggles } from "./modules/Toggles";
|
|
import { PowerProfileBox } from "./modules/PowerProfileBox";
|
|
import { BatteryBox } from "./modules/BatteryBox";
|
|
|
|
export default function QuickActions() {
|
|
const powerprofiles = PowerProfiles.get_default();
|
|
const hasProfiles = powerprofiles?.get_profiles()?.length > 0;
|
|
const { TOP, RIGHT } = Astal.WindowAnchor;
|
|
const visible = Variable(false);
|
|
return (
|
|
<window
|
|
name="system-menu"
|
|
application={App}
|
|
layer={Astal.Layer.OVERLAY}
|
|
anchor={TOP | RIGHT}
|
|
keymode={Astal.Keymode.ON_DEMAND}
|
|
visible={visible()}
|
|
>
|
|
<box cssClasses={["system-menu"]} vertical>
|
|
<Toggles />
|
|
{hasProfiles && <PowerProfileBox />}
|
|
<Sliders />
|
|
<BatteryBox />
|
|
</box>
|
|
</window>
|
|
);
|
|
}
|