Skip to content

Commit 191d5e5

Browse files
committed
docs: apps page
also add icons
1 parent e06ae73 commit 191d5e5

File tree

9 files changed

+143
-53
lines changed

9 files changed

+143
-53
lines changed

docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import DefaultTheme from 'vitepress/theme'
2-
import '../../vitepress.theme.css'
1+
import DefaultTheme from "vitepress/theme"
2+
import "../../vitepress.theme.css"
3+
import "devicon/devicon.min.css"
34

45
export default DefaultTheme

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Hosted at [aylur.github.io/astal](https://aylur.github.io/astal/) and [aylur.git
88
| Command | Action |
99
| :---------------- | :------------------------------------------ |
1010
| `npm install` | Installs dependencies |
11-
| `npm run dev` | Starts local dev server at `localhost:4321` |
11+
| `npm run dev` | Starts local dev server at `localhost:5173` |
1212
| `npm run build` | Build your production site to `./dist/` |
1313
| `npm run preview` | Preview your build locally |
1414

docs/ags/installation.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,18 @@ nix run github:aylur/ags/v2 -- --help
2121

2222
:::code-group
2323

24-
```sh [Arch]
24+
```sh [<i class="devicon-archlinux-plain"></i> Arch]
2525
sudo pacman -Syu go npm gjs
2626
```
2727

28-
```sh [Fedora]
28+
```sh [<i class="devicon-fedora-plain"></i> Fedora]
2929
sudo dnf install golang npm gjs
3030
```
3131

32-
```sh [Alpine]
33-
sudo apk add go npm gjs
34-
```
35-
36-
```sh [Ubuntu]
32+
```sh [<i class="devicon-ubuntu-plain"></i> Ubuntu]
3733
sudo apt install golang-go npm gjs
3834
```
3935

40-
```sh [openSUSE]
41-
sudo zypper install go npm gjs
42-
```
43-
4436
:::
4537

4638
3. Clone the repo and Install

docs/getting-started/installation.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,18 @@ cd astal/core
3535

3636
:::code-group
3737

38-
```sh [Arch]
38+
```sh [<i class="devicon-archlinux-plain"></i> Arch]
3939
sudo pacman -Syu meson vala gtk3 gtk-layer-shell gobject-introspection
4040
```
4141

42-
```sh [Fedora]
43-
sudo dnf install meson gcc valac gtk3-devel gtk-layer-shell-devel
42+
```sh [<i class="devicon-fedora-plain"></i> Fedora]
43+
sudo dnf install meson gcc valac gtk3-devel gtk-layer-shell-devel gobject-introspection-devel
4444
```
4545

46-
```sh [Alpine]
47-
sudo apk add meson g++ vala gtk+3.0-dev gtk-layer-shell-dev gobject-introspection-dev
48-
```
49-
50-
```sh [Ubuntu]
46+
```sh [<i class="devicon-ubuntu-plain"></i> Ubuntu]
5147
sudo apt install meson valac libgtk3-dev libgtk-layer-shell-dev gobject-introspection
5248
```
5349

54-
```sh [openSUSE]
55-
sudo zypper install gcc meson vala gtk3-devel gtk-layer-shell-devel gobject-introspection-devel
56-
```
57-
5850
:::
5951

6052
3. Build and install with `meson`
@@ -64,7 +56,7 @@ meson setup build
6456
meson install -C build
6557
```
6658

67-
:::info
59+
:::tip
6860
Most distros recommend manual installs in `/usr/local`,
6961
which is what `meson` defaults to. If you want to install to `/usr`
7062
instead which most package managers do, set the `prefix` option:

docs/libraries/apps.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,96 @@
11
# Apps
2+
3+
Library and CLI tool for querying and launching
4+
applications that have a corresponding `.desktop` file.
5+
6+
## Installation
7+
8+
1. install dependencies
9+
10+
:::code-group
11+
12+
```sh [<i class="devicon-archlinux-plain"></i> Arch]
13+
sudo pacman -Syu meson vala json-glib gobject-introspection
14+
```
15+
16+
```sh [<i class="devicon-fedora-plain"></i> Fedora]
17+
sudo dnf install meson gcc valac json-glib-devel gobject-introspection-devel
18+
```
19+
20+
```sh [<i class="devicon-ubuntu-plain"></i> Ubuntu]
21+
sudo apt install meson valac libjson-glib-dev gobject-introspection
22+
```
23+
24+
:::
25+
26+
2. clone repo
27+
28+
```sh
29+
git clone https://github.com/aylur/astal.git
30+
cd astal/lib/apps
31+
```
32+
33+
3. clone repo
34+
35+
```sh
36+
meson setup build
37+
meson install -C build
38+
```
39+
40+
:::tip
41+
Most distros recommend manual installs in `/usr/local`,
42+
which is what `meson` defaults to. If you want to install to `/usr`
43+
instead which most package managers do, set the `prefix` option:
44+
45+
```sh
46+
meson setup --prefix /usr build
47+
meson install -C build
48+
```
49+
50+
:::
51+
52+
## Usage
53+
54+
You can browse the [Apps reference](https://aylur.github.io/libastal/apps).
55+
56+
### CLI
57+
58+
```sh
59+
astal-apps --help
60+
```
61+
62+
### Library
63+
64+
:::code-group
65+
66+
```js [<i class="devicon-javascript-plain"></i> JavaScript]
67+
import Apps from "gi://AstalApps"
68+
69+
const apps = new Apps.Apps({
70+
includeEntry: true,
71+
includeExecutable: true,
72+
})
73+
74+
print(apps.fuzzy_query("spotify")
75+
.map(app => app.name)
76+
.join("\n"))
77+
```
78+
79+
```py [<i class="devicon-python-plain"></i> Python]
80+
# Not yet documented, contributions are appreciated
81+
```
82+
83+
```lua [<i class="devicon-lua-plain"></i> Lua]
84+
-- Not yet documented, contributions are appreciated
85+
```
86+
87+
```vala [<i class="devicon-vala-plain"></i> Vala]
88+
// Not yet documented, contributions are appreciated
89+
```
90+
91+
:::
92+
93+
:::info
94+
The fuzzy query uses [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance). I am not a mathematician, but if you know how to reimplement
95+
the logic of [fzf](https://github.com/junegunn/fzf) to make it better feel free to open PRs.
96+
:::

docs/libraries/libastal.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
"build": "vitepress build",
1212
"preview": "vitepress preview",
1313
"vitepress": "vitepress"
14+
},
15+
"dependencies": {
16+
"devicon": "^2.16.0"
1417
}
1518
}

docs/vitepress.config.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig } from "vitepress"
22

33
function github(url = "") {
44
return `https://github.com/aylur/astal${url}`
@@ -16,53 +16,53 @@ export default defineConfig({
1616
ignoreDeadLinks: true, // FIXME:
1717

1818
head: [
19-
['link', { rel: 'icon', href: '/astal/favicon.ico' }],
19+
["link", { rel: "icon", href: "/astal/favicon.ico" }],
2020
],
2121

2222
themeConfig: {
2323
// logo: "",
2424
//
2525

2626
nav: [{
27-
text: '0.1.0',
27+
text: "0.1.0",
2828
items: [
29-
{ text: 'Contributing', link: github("/blob/main/CONTRIBUTING.md") },
30-
{ text: 'Changelog', link: github("/blob/main/CHANGELOG.md") },
29+
{ text: "Contributing", link: github("/blob/main/CONTRIBUTING.md") },
30+
{ text: "Changelog", link: github("/blob/main/CHANGELOG.md") },
3131
],
3232
}],
3333

3434
sidebar: [
3535
{
36-
text: 'Getting Started',
36+
text: "Getting Started",
3737
base: "/getting-started",
3838
collapsed: false,
3939
items: [
40-
{ text: 'Introduction', link: '/introduction' },
41-
{ text: 'Installation', link: '/installation' },
42-
{ text: 'Supported Languages', link: '/supported-languages' },
40+
{ text: "Introduction", link: "/introduction" },
41+
{ text: "Installation", link: "/installation" },
42+
{ text: "Supported Languages", link: "/supported-languages" },
4343
],
4444
},
4545
{
46-
text: 'AGS',
46+
text: "AGS",
4747
base: "/ags",
4848
collapsed: false,
4949
items: [
50-
{ text: 'Installation', link: '/installation' },
51-
{ text: 'First Widgets', link: '/first-widgets' },
52-
{ text: 'Theming', link: '/theming' },
53-
{ text: 'CLI and App', link: '/cli-app' },
54-
{ text: 'Widget', link: '/widget' },
55-
{ text: 'Utilities', link: '/utilities' },
56-
{ text: 'Variable', link: '/variable' },
57-
{ text: 'FAQ', link: '/faq' },
50+
{ text: "Installation", link: "/installation" },
51+
{ text: "First Widgets", link: "/first-widgets" },
52+
{ text: "Theming", link: "/theming" },
53+
{ text: "CLI and App", link: "/cli-app" },
54+
{ text: "Widget", link: "/widget" },
55+
{ text: "Utilities", link: "/utilities" },
56+
{ text: "Variable", link: "/variable" },
57+
{ text: "FAQ", link: "/faq" },
5858
],
5959
},
6060
{
61-
text: 'Libraries',
61+
text: "Libraries",
6262
collapsed: true,
6363
items: [
64-
{ text: 'References', link: '/libraries/references' },
65-
{ text: "Astal", link: "/libraries/libastal" },
64+
{ text: "References", link: "/libraries/references" },
65+
{ text: "Astal", link: "https://aylur.github.io/libastal" },
6666
{ text: "Apps", link: "/libraries/apps" },
6767
{ text: "Auth", link: "/libraries/auth" },
6868
{ text: "Battery", link: "/libraries/battery" },
@@ -80,17 +80,17 @@ export default defineConfig({
8080
],
8181

8282
socialLinks: [
83-
{ icon: 'github', link: github() },
84-
{ icon: 'discord', link: '"https://discord.gg/CXQpHwDuhY"' },
83+
{ icon: "github", link: github() },
84+
{ icon: "discord", link: "https://discord.gg/CXQpHwDuhY" },
8585
],
8686

8787
editLink: {
8888
pattern: github("/edit/main/docs/:path"),
89-
text: 'Edit this page on GitHub',
89+
text: "Edit this page on GitHub",
9090
},
9191

9292
lastUpdated: {
93-
text: 'Last updated',
93+
text: "Last updated",
9494
},
9595

9696
search: {

0 commit comments

Comments
 (0)