mirror of
https://github.com/zephrynis/nix-flake.git
synced 2026-02-18 20:21:53 +00:00
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.
This commit is contained in:
69
home/ags-config/modules/compositors/hyprland.ts
Normal file
69
home/ags-config/modules/compositors/hyprland.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user