diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/default.nix | 7 | ||||
-rw-r--r-- | docs/guide/libraries/apps.md | 25 | ||||
-rw-r--r-- | docs/guide/libraries/cava.md | 91 | ||||
-rw-r--r-- | docs/vitepress.config.ts | 1 |
4 files changed, 117 insertions, 7 deletions
diff --git a/docs/default.nix b/docs/default.nix index 0d79ce1..1370fc6 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -154,6 +154,13 @@ in version = ../lib/bluetooth/version; }} ${genLib { + flakepkg = "cava"; + gir = "Cava"; + description = "Audio visualization library using cava"; + version = ../lib/cava/version; + authors = "kotontrion"; + }} + ${genLib { flakepkg = "hyprland"; gir = "Hyprland"; description = "IPC client for Hyprland"; diff --git a/docs/guide/libraries/apps.md b/docs/guide/libraries/apps.md index 7349951..1871d18 100644 --- a/docs/guide/libraries/apps.md +++ b/docs/guide/libraries/apps.md @@ -55,8 +55,9 @@ astal-apps --help import Apps from "gi://AstalApps" const apps = new Apps.Apps({ - includeEntry: true, - includeExecutable: true, + nameMultiplier: 2, + entryMultiplier: 0, + executableMultiplier: 2, }) for (const app of apps.fuzzy_query("spotify")) { @@ -68,8 +69,9 @@ for (const app of apps.fuzzy_query("spotify")) { from gi.repository import AstalApps as Apps apps = Apps.Apps( - include_entry=True, - include_executable=True, + name_multiplier=2, + entry_multiplier=0, + executable_multiplier=2, ) for app in apps.fuzzy_query("obsidian"): @@ -81,8 +83,9 @@ for app in apps.fuzzy_query("obsidian"): local Apps = require("lgi").require("AstalApps") local apps = Apps.Apps({ - include_entry = true, - include_executable = true, + name_multiplier = 2, + entry_multiplier = 0, + executable_multiplier = 2, }) for _, app in ipairs(apps:fuzzy_query("lutris")) do @@ -91,7 +94,15 @@ end ``` ```vala [<i class="devicon-vala-plain"></i> Vala] -// Not yet documented, contributions are appreciated +var apps = new AstalApps.Apps() { + name_multiplier = 2, + entry_multiplier = 0, + executable_multiplier = 2, +}; + +foreach (var app in apps.fuzzy_query("firefox")) { + print(app.name); +} ``` ::: diff --git a/docs/guide/libraries/cava.md b/docs/guide/libraries/cava.md new file mode 100644 index 0000000..e695e16 --- /dev/null +++ b/docs/guide/libraries/cava.md @@ -0,0 +1,91 @@ +# Cava + +Audio visualizer using [cava](https://github.com/karlstav/cava). + +## Installation + +1. install dependencies + +Note that it requires [libcava](https://github.com/LukashonakV/cava), a fork of cava, which provides cava as a shared library. + +:::code-group + +```sh [<i class="devicon-archlinux-plain"></i> Arch] +sudo pacman -Syu meson vala gobject-introspection +paru -S libcava +``` + +```sh [<i class="devicon-fedora-plain"></i> Fedora] +# Not yet documented +``` + +```sh [<i class="devicon-ubuntu-plain"></i> Ubuntu] +# Not yet documented +``` + +::: + +2. clone repo + +```sh +git clone https://github.com/aylur/astal.git +cd astal/lib/cava +``` + +3. install + +```sh +meson setup build +meson install -C build +``` + +:::tip +Most distros recommend manual installs in `/usr/local`, +which is what `meson` defaults to. If you want to install to `/usr` +instead which most package managers do, set the `prefix` option: + +```sh +meson setup --prefix /usr build +``` + +::: + +## Usage + +You can browse the [Cava reference](https://aylur.github.io/libastal/cava). + +### CLI + +There is no CLI for this library, use the one provided by cava. + +```sh +cava +``` + +### Library + +:::code-group + +```js [<i class="devicon-javascript-plain"></i> JavaScript] +import Cava from "gi://AstalCava" + +const cava = Cava.get_default() + +cava.connect("notify::values", () => { + print(cava.get_values()) +}) +``` + +```py [<i class="devicon-python-plain"></i> Python] +# Not yet documented +``` + +```lua [<i class="devicon-lua-plain"></i> Lua] +-- Not yet documented +``` + +```vala [<i class="devicon-vala-plain"></i> Vala] +// Not yet documented +``` + +::: diff --git a/docs/vitepress.config.ts b/docs/vitepress.config.ts index 2df3eea..f542a68 100644 --- a/docs/vitepress.config.ts +++ b/docs/vitepress.config.ts @@ -104,6 +104,7 @@ export default defineConfig({ { text: "Auth", link: "/guide/libraries/auth" }, { text: "Battery", link: "/guide/libraries/battery" }, { text: "Bluetooth", link: "/guide/libraries/bluetooth" }, + { text: "Cava", link: "/guide/libraries/cava" }, { text: "Hyprland", link: "/guide/libraries/hyprland" }, { text: "Mpris", link: "/guide/libraries/mpris" }, { text: "Network", link: "/guide/libraries/network" }, |