diff options
author | Aylur <[email protected]> | 2024-09-14 11:59:09 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-14 11:59:09 +0200 |
commit | 45a3118f79970aebb561a31b050c2a63fc202c91 (patch) | |
tree | 5125d930cff745b93d579dc1d0e877af9ae405b4 /docs/libraries/hyprland.md | |
parent | e9f9de6ba557de6a553f03de813af0fdbdbec047 (diff) | |
parent | 4d5c7a7b514c7f4f71b2950f051b64c3e3df3008 (diff) |
Merge pull request #9 from tokyob0t/main
Added examples for python and lua to the docs :nerd_face:
Diffstat (limited to 'docs/libraries/hyprland.md')
-rw-r--r-- | docs/libraries/hyprland.md | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/docs/libraries/hyprland.md b/docs/libraries/hyprland.md index 0bc20c4..faf9e50 100644 --- a/docs/libraries/hyprland.md +++ b/docs/libraries/hyprland.md @@ -62,19 +62,32 @@ 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() -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] -# Not yet documented +from gi.repository import AstalHyprland as Hyprland + +hyprland = Hyprland.get_default() + +for client in hyprland.get_clients(): + print(client.get_title()) ``` ```lua [<i class="devicon-lua-plain"></i> Lua] --- Not yet documented +local Hyprland = require("lgi").require("AstalHyprland") + +local hyprland = Hyprland.get_default() + +for _, c in ipairs(hyprland.clients) do + print(c.title) +end ``` ```vala [<i class="devicon-vala-plain"></i> Vala] |