summaryrefslogtreecommitdiff
path: root/docs/libraries/hyprland.md
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-14 09:55:29 +0000
committerAylur <[email protected]>2024-09-14 09:55:29 +0000
commit4d5c7a7b514c7f4f71b2950f051b64c3e3df3008 (patch)
tree5125d930cff745b93d579dc1d0e877af9ae405b4 /docs/libraries/hyprland.md
parentc2308daf897055e056a0a51fbc445f7902c2f90b (diff)
docs: lib examples consistency
Diffstat (limited to 'docs/libraries/hyprland.md')
-rw-r--r--docs/libraries/hyprland.md27
1 files changed, 12 insertions, 15 deletions
diff --git a/docs/libraries/hyprland.md b/docs/libraries/hyprland.md
index 8018773..faf9e50 100644
--- a/docs/libraries/hyprland.md
+++ b/docs/libraries/hyprland.md
@@ -62,34 +62,31 @@ astal-hyprland # starts monitoring
:::code-group
```js [<i class="devicon-javascript-plain"></i> JavaScript]
-import Hyprland from "gi://AstalHyprland";
+import Hyprland from "gi://AstalHyprland"
-const hyprland = Hyprland.get_default();
+const hyprland = Hyprland.get_default()
-console.log(hyprland.get_clients().map((c) => c.title));
+for (const client of hyprland.get_clients()) {
+ print(client.title)
+}
```
```py [<i class="devicon-python-plain"></i> Python]
-import gi
+from gi.repository import AstalHyprland as Hyprland
-gi.require_version("AstalHyprland", "0.1")
+hyprland = Hyprland.get_default()
-from gi.repository import AstalHyprland
-
-hyprland = AstalHyprland.get_default()
-
-print("\n".join(c.get_title() for c in hyprland.get_clients()))
+for client in hyprland.get_clients():
+ print(client.get_title())
```
```lua [<i class="devicon-lua-plain"></i> Lua]
-local lgi = require("lgi")
-
-local AstalHyprland = lgi.require("AstalHyprland", "0.1")
+local Hyprland = require("lgi").require("AstalHyprland")
-local hyprland = AstalHyprland.get_default()
+local hyprland = Hyprland.get_default()
for _, c in ipairs(hyprland.clients) do
- print(c.title)
+ print(c.title)
end
```