Skip to content

Commit

Permalink
Merge pull request #24 from notok/fix_codes
Browse files Browse the repository at this point in the history
Fix typo and bug in sample codes
  • Loading branch information
Aylur authored Mar 18, 2024
2 parents c3dcf5e + 158035b commit 031e16c
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/config/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const label = Widget.Label()

If you want to change the style sheet on runtime

specifing a css file
specifying a css file

```js
App.applyCss('/path/to/file.css');
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/config/config-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ properties will be applied on top of previous calls
// config.js
App.config({
style: "./style.css",
icons: "./assests",
icons: "./assets",
windows: [
// Array<Gtk.Window>
],
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/config/custom-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class BrightnessService extends Service {
#onChange() {
this.#screenValue = Number(Utils.exec('brightnessctl get')) / this.#max;

// signals have to be explicity emitted
// signals have to be explicitly emitted
this.emit('changed'); // emits "changed"
this.notify('screen-value'); // emits "notify::screen-value"

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/config/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ while (i < 5) {
for loop

```js
for (let i = 0; 0 < 5; i++) {
for (let i = 0; i < 5; i++) {
print(i)
}
```
Expand Down Expand Up @@ -154,7 +154,7 @@ function fn({ one, two }) {
}

fn({ one: 'hello', two: 'mom' }) // hello, mom
fn() // throws error because undefined can't be destructued
fn() // throws error because undefined can't be destructed
```

## Modules
Expand All @@ -163,7 +163,7 @@ exporting

```js
export default 'hello'
export const hi = 'mom'
export const string = 'mom'
export function fn(...params) {
print(...params)
}
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/config/services.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Services
description: Builtig services to query system information
description: Builtin services to query system information
---

A Service is an instance of a [GObject.Object](https://gjs-docs.gnome.org/gobject20~2.0/gobject.object)
Expand Down Expand Up @@ -47,7 +47,7 @@ someService.connect('changed', (service, ...args) => {

:::caution
If you reference a widget inside `someService.connect`, make sure to
handle disconnection aswell if that widget is destroyed
handle disconnection as well if that widget is destroyed
:::

## List of builtin services
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/config/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ on NixOS make sure you have `security.pam.services.ags = {}` in `configuration.n

```js
Utils.authenticate('password')
.then(() => print('authentication sucessful'))
.catch(err => logError(err, 'unsucessful'))
.then(() => print('authentication successful'))
.catch(err => logError(err, 'unsuccessful'))
Utils.authenticateUser("username", "password")
.then(() => print("authentication sucessful"))
.catch(err => logError(err, 'unsucessful'))
.then(() => print("authentication successful"))
.catch(err => logError(err, 'unsuccessful'))
```

## Send Notifications
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/config/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ These widgets have some additional properties on top of the base Gtk.Widget ones
|----------|------|-------------|
| class-name | `string` | List of class CSS selectors separated by white space. |
| class-names | `Array<string>` | List of class CSS selectors. |
| css | `string` | Inline CSS. e.g `label { color: white; }`. If no selector is specifed `*` will be assumed. e.g `color: white;` will be inferred as `*{ color: white; }`. |
| css | `string` | Inline CSS. e.g `label { color: white; }`. If no selector is specified `*` will be assumed. e.g `color: white;` will be inferred as `*{ color: white; }`. |
| hpack | `string` | Horizontal alignment, behaves like `halign`. `halign` takes an enum, but for convenience `hpack` can be given with a string, so one of `"start"`, `"center"`, `"end"`, `"fill"`. |
| vpack | `string` | Vertical alignment. |
| cursor | `string` | Cursor style when hovering over widgets that have hover states, e.g it won't work on labels. [list of valid values](https://docs.gtk.org/gdk3/ctor.Cursor.new_from_name.html). |
Expand All @@ -27,7 +27,7 @@ Some common Gtk.Widget properties you might want for example
| vexpand | boolean | Expand vertically. |
| sensitive | boolean | Makes the widget interactable. |
| tooltip-text | string | Tooltip popup when the widget is hovered over. |
| visible | boolean | Visibility of the widget. Setting this to `false` doesn't have any effect if the parent container calls `show_all()`, for example when you set a Box's childen dynamically. |
| visible | boolean | Visibility of the widget. Setting this to `false` doesn't have any effect if the parent container calls `show_all()`, for example when you set a Box's children dynamically. |

If you don't want to mutate the `classNames` array,
there is `toggleClassName`: `(name: string, enable: boolean) => void`
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/services/backlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: Backlight
---

There is no builtin Backligh service, but you can find an [example service implementation](../../config/custom-service) using `brightnessctl`.
There is no builtin Backlight service, but you can find an [example service implementation](../../config/custom-service) using `brightnessctl`.
2 changes: 1 addition & 1 deletion src/content/docs/services/bluetooth.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Bluetooth
---

:::note
package dependancy: `gnome-bluetooth-3.0`
package dependency: `gnome-bluetooth-3.0`
for the battery percentage to work, make sure you have `Experimental = true` in `/etc/bluetooth/main.conf`
:::

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/services/mpris.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Not every media player supports `position`, `volume` and other functionality. Su

### signals

* `position`: `(positon: number)` this is signaled when the position is set explicitly
* `position`: `(position: number)` this is signaled when the position is set explicitly
* `closed`

### properties
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/services/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Network
---

:::note
package dependancy: `network-manager`
package dependency: `network-manager`
This service is somewhat incomplete, feel free to open a PR to improve it
:::

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/services/powerprofiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Power Profiles
---

:::note
package dependancy: `power-profiles-daemon`
package dependency: `power-profiles-daemon`
on NixOS enable `services.power-profiles-daemon`
:::

Expand Down

0 comments on commit 031e16c

Please sign in to comment.