Files
nix-flake/home/ags-config/modules/compositors/hyprland.ts
Zephrynis b2ae32a078 feat: make AGS colorshell configuration fully declarative
- Add complete colorshell v2.0.3 configuration to home/ags-config/
- Disable runner plugin and NightLight tile (incompatible with NixOS)
- Customize SCSS with full opacity (no transparency)
- Add dark pale blue color scheme in home/pywal-colors/
- Configure Papirus-Dark icon theme via home-manager
- Make ~/.config/ags/ immutable and managed by Nix store
- Auto-deploy pywal colors to ~/.cache/wal/colors.json

All AGS configuration is now reproducible and version controlled.
2025-11-04 21:36:38 +00:00

70 lines
2.3 KiB
TypeScript

import { Compositors } from ".";
import { register } from "ags/gobject";
import { createRoot, getScope, Scope } from "ags";
import { createScopedConnection } from "../utils";
import AstalHyprland from "gi://AstalHyprland";
type Event = "activewindow" | "activewindowv2"
| "workspace" | "workspacev2"
| "focusedmon" | "focusedmonv2";
@register({ GTypeName: "CompositorHyprland" })
export class CompositorHyprland extends Compositors.Compositor {
#scope: Scope;
hyprland: AstalHyprland.Hyprland;
protected _focusedClient: Compositors.Client | null = null;
constructor() {
super();
try {
this.hyprland = AstalHyprland.get_default();
} catch(e) {
throw new Error(`Couldn't initialize CompositorHyprland: ${e}`);
}
this.#scope = createRoot(() => {
createScopedConnection(
this.hyprland, "event", (e, args) => {
switch(e as Event) {
case "activewindowv2":
const address = args;
const clients = AstalHyprland.get_default().clients;
const focusedClient = clients.filter(c =>
c.address === address
)[0];
if(focusedClient) {
this._focusedClient = new Compositors.Client({
address: address,
class: focusedClient.class ?? "",
initialClass: focusedClient.initialClass ?? "",
mapped: focusedClient.mapped,
position: [focusedClient.x, focusedClient.y],
title: focusedClient.title ?? ""
});
this.notify("focused-client");
return;
}
this._focusedClient = null;
this.notify("focused-client");
break;
}
}
);
return getScope();
});
}
vfunc_dispose(): void {
this.#scope.dispose();
}
}