summaryrefslogtreecommitdiff
path: root/docs/guide/ags/cli-app.md
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-10-10 11:28:11 +0200
committerkotontrion <[email protected]>2024-10-10 11:28:11 +0200
commit08f10ce3968166c55f5f2e3009415e4899e9a73b (patch)
treec6f914debe8f86e8ec7275f86a4181b20cf5f45a /docs/guide/ags/cli-app.md
parent10447f5abcb28f3df1544f1732f82d538130b3c9 (diff)
parent075c7e34aa0fbdc07c86965ab5a2ae79b92d3fd3 (diff)
Merge branch 'main' into feat/cava
Diffstat (limited to 'docs/guide/ags/cli-app.md')
-rw-r--r--docs/guide/ags/cli-app.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/guide/ags/cli-app.md b/docs/guide/ags/cli-app.md
index ceed56a..ec6d174 100644
--- a/docs/guide/ags/cli-app.md
+++ b/docs/guide/ags/cli-app.md
@@ -95,6 +95,42 @@ ags -m "return 'hello';"
# hello
```
+## Toggling Windows by their name
+
+In order for AGS to know about your windows, you have to register them.
+You can do this by specifying a **unique** `name` and calling `App.add_window`
+
+```tsx {4}
+import { App } from "astal"
+
+function Bar() {
+ return <window name="Bar" setup={self => App.add_window(self)}>
+ <box />
+ </window>
+}
+```
+
+You can also invoke `App.add_window` by simply passing the `App` to the `application` prop.
+
+```tsx {4}
+import { App } from "astal"
+
+function Bar() {
+ return <window name="Bar" application={App}>
+ <box />
+ </window>
+}
+```
+
+:::warning
+When assigning the `application` prop make sure `name` comes before.
+Props are set sequentially and if name is applied after application it won't work.
+:::
+
+```sh
+ags -t Bar
+```
+
## App without AGS
As mentioned before AGS is only a scaffolding tool. You can setup