[AGS] Save for migration to GTK4

This commit is contained in:
2025-04-21 17:26:52 +02:00
parent f4b259dd13
commit 7380c75818
4 changed files with 30 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import AstalTray from "gi://AstalTray";
import { bind } from "astal";
import { bind, Variable } from "astal";
import AstalHyprland from "gi://AstalHyprland";
const SysTray = () => {
@@ -42,14 +42,25 @@ const Workspace = () => {
const ActiveWindow = () => {
const hypr = AstalHyprland.get_default();
const focused = bind( hypr, "focusedClient" );
let visible = Variable( false );
const toggleOverlay = () => {
visible.set( !visible.get() );
}
return <box className={"HyprlandFocusedClients"} visible={focused.as(Boolean)}>
{focused.as( client => (
client && <label label={bind( client, "title" ).as( String )} />
))}
<button onClicked={toggleOverlay}>
{focused.as( client => (
client && <label label={bind( client, "title" ).as( String )} />
))}
</button>
<eventbox visible={bind(visible).as( v => v )} name="popover-container">
<label label="This is a test"></label>
</eventbox>
</box>
}
export default {
Workspace,
ActiveWindow,