Skip to content

Commit

Permalink
docs: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Aylur committed Nov 15, 2024
1 parent f608c66 commit 3e270c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/guide/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Simple dialog example to get a `no`/`yes` answer.

![2024-11-13_00-45-58](https://github.com/user-attachments/assets/73a20155-fa0e-4156-aff8-3a0d055abb9b)

```tsx
:::code-group

```tsx [dialog.ts]
#!/usr/bin/ags run
import { App, Astal, Gtk, Gdk } from "astal/gtk3"

Expand Down Expand Up @@ -88,10 +90,12 @@ App.start({
})
```

:::

Then it can be used in any script.

```sh
if [[ "$(script -a Shutdown)" == "yes" ]]; then
if [[ "$(./dialog.ts -a Shutdown)" == "yes" ]]; then
shutdown now
fi
```
Expand Down
21 changes: 17 additions & 4 deletions docs/guide/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ App.config({
})
App.main({ // [!code ++:5]
main() {
Widget.Window()
new Widget.Window()
}
})
```
Expand Down Expand Up @@ -186,7 +186,7 @@ is also a lot more flexible.

## Globals

`App`, `Service`, `Utils`, `Widget`, `Variable` is no longer globally available
`App`, `Service`, `Utils`, `Widget`, `Variable` are no longer globally available

```js
import { Widget, App } from "astal/gtk3"
Expand All @@ -199,7 +199,7 @@ import Variable from "astal/variable"
## Services

These are no longer called `Service`. There is no longer a distinction
between a `Service` and `GObject.Object` and they are no longer builtin.
between a `Service` and `GObject.Object` and there are no longer builtin Services.

These are now simply external [libraries](https://aylur.github.io/astal/guide/libraries/references#astal-libraries)
that will have to be installed next to AGS. They are now implemented in Vala or C
Expand Down Expand Up @@ -254,7 +254,7 @@ File, Process and Time utility functions are available from their own
Utils.exec("command") // [!code --:3]
Utils.readFile("file")
Utils.timeout(1000, callback)
import { exec, readFile, timeout} from "astal" // [!code ++:4]
import { exec, readFile, timeout } from "astal" // [!code ++:4]
exec("command")
readFile("file")
timeout(1000, callback)
Expand Down Expand Up @@ -283,6 +283,19 @@ To make windows toggleable through cli you will have to now
[pass the `App` instance to `Window`](https://aylur.github.io/astal/guide/typescript/cli-app#toggling-windows-by-their-name) instances instead of passing
a an array of windows to `App.config`.

```js
App.config({ // [!code --:5]
windows: [
Widget.Window({ name: "window-name" })
]
})
App.start({ // [!code ++:5]
main() {
<window name="window-name" application={App}></window>
}
})
```

`ags --run-js` have been retired in favor of [requests](https://aylur.github.io/astal/guide/typescript/cli-app#messaging-from-cli).

```ts
Expand Down

0 comments on commit 3e270c8

Please sign in to comment.