From 8c6d2185a68e9f09d6780284d1b61fcfaefa655b Mon Sep 17 00:00:00 2001 From: Aylur <104676705+Aylur@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:00:44 +0100 Subject: Update first-widgets.md --- docs/guide/typescript/first-widgets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/guide') diff --git a/docs/guide/typescript/first-widgets.md b/docs/guide/typescript/first-widgets.md index a7372a8..b7724e1 100644 --- a/docs/guide/typescript/first-widgets.md +++ b/docs/guide/typescript/first-widgets.md @@ -363,7 +363,7 @@ by setting `noImplicityDestroy` property on the container widget. :::info The above example destroys and recreates every widget in the list **every time** the value of the `Variable` changes. There might be cases where you would -want to [handle child creation and deletion](/guide/typescript/faq#avoiding-unnecessary-re-rendering) +want to handle child creation and deletion yourself, because you don't want to lose the inner state of widgets that does not need to be recreated. In this case you can create a [custom reactive structure](./binding#example-custom-subscribable) -- cgit v1.2.3 From 524030ae79f5cffafef3ef09036064070e814879 Mon Sep 17 00:00:00 2001 From: Aylur Date: Tue, 5 Nov 2024 20:00:44 +0000 Subject: feat: greetd ipc client --- docs/guide/libraries/greet.md | 94 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 docs/guide/libraries/greet.md (limited to 'docs/guide') diff --git a/docs/guide/libraries/greet.md b/docs/guide/libraries/greet.md new file mode 100644 index 0000000..f0cd012 --- /dev/null +++ b/docs/guide/libraries/greet.md @@ -0,0 +1,94 @@ +# Greet + +Library and CLI tool for sending requests to [greetd](https://sr.ht/~kennylevinsen/greetd/). + +## Installation + +1. install dependencies + +:::code-group + +```sh [ Arch] +sudo pacman -Syu meson vala json-glib gobject-introspection +``` + +```sh [ Fedora] +sudo dnf install meson vala valadoc json-glib-devel gobject-introspection-devel +``` + +```sh [ Ubuntu] +sudo apt install meson valac libjson-glib-dev gobject-introspection +``` + +::: + +::: info +Although `greetd` is not a direct build dependency, +it should be self-explanatory that the daemon is required to be available at runtime. +::: + +2. clone repo + +```sh +git clone https://github.com/aylur/astal.git +cd astal/lib/greet +``` + +3. install + +```sh +meson setup --prefix /usr build +meson install -C build +``` + +## Usage + +You can browse the [Greet reference](https://aylur.github.io/libastal/greet). + +### CLI + +```sh +astal-greet --help +``` + +### Library + +:::code-group + +```js [ JavaScript] +import Greet from "gi://AstalGreet" + +Greet.login("username", "password", "compositor", (_, res) => { + try { + Greet.login_finish(res) + } catch (err) { + printerr(err) + } +}) +``` + +```py [ Python] +# Not yet documented + +``` + +```lua [ Lua] +local Greet = require("lgi").require("AstalGreet") + +Greet.login("username", "password", "compositor", function (_, res) + local err = Greet.login_finish(res) + if err ~= nil then + print(err) + end +end) +``` + +```vala [ Vala] +try { + yield AstalGreet.login("username", "password", "compositor"); +} catch (Error err) { + printerr(err.message); +} +``` + +::: -- cgit v1.2.3 From 84c02e54d3bd25958dafa67a7420cf29b3375de1 Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 6 Nov 2024 04:07:55 +0000 Subject: docs: adjust for ags changes --- docs/guide/typescript/cli-app.md | 4 ++-- docs/guide/typescript/first-widgets.md | 6 +++--- docs/guide/typescript/installation.md | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'docs/guide') diff --git a/docs/guide/typescript/cli-app.md b/docs/guide/typescript/cli-app.md index f409176..85b117c 100644 --- a/docs/guide/typescript/cli-app.md +++ b/docs/guide/typescript/cli-app.md @@ -61,7 +61,7 @@ astal say hi ``` ```sh [ags] -ags -m "say hi" +ags request "say hi" # hi cli ``` @@ -135,7 +135,7 @@ astal -t Bar ``` ```sh [ags] -ags -t Bar +ags toggle Bar ``` ::: diff --git a/docs/guide/typescript/first-widgets.md b/docs/guide/typescript/first-widgets.md index b7724e1..96a1275 100644 --- a/docs/guide/typescript/first-widgets.md +++ b/docs/guide/typescript/first-widgets.md @@ -5,13 +5,13 @@ Start by initializing a project ```sh -ags --init +ags init ``` -then run `ags` in the terminal +then run `ags run` in the terminal ```sh -ags +ags run ``` :::details Usage without AGS diff --git a/docs/guide/typescript/installation.md b/docs/guide/typescript/installation.md index f1d20c5..e0f1bd5 100644 --- a/docs/guide/typescript/installation.md +++ b/docs/guide/typescript/installation.md @@ -71,7 +71,6 @@ sudo apt install golang-go npm gjs git clone https://github.com/aylur/ags.git /tmp/ags cd /tmp/ags git checkout v2 # https://github.com/Aylur/ags/pull/504 -cd src go install ``` -- cgit v1.2.3