### Build and Install astal-io Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Builds and installs the `astal-io` component after navigating to its directory. Requires dependencies to be installed and the repository to be cloned. ```sh cd lib/astal/io meson setup build meson install -C build ``` -------------------------------- ### Install Dependencies Source: https://github.com/aylur/astal/blob/main/docs/README.md Use this command to install all necessary project dependencies. ```bash npm install ``` -------------------------------- ### Start Local Development Server Source: https://github.com/aylur/astal/blob/main/docs/README.md Starts a local development server for real-time previewing of changes. ```bash npm run dev ``` -------------------------------- ### Install appmenu-glib-translator Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Clones the vala-panel-appmenu repository, navigates to the appmenu-glib-translator subproject, and installs it using Meson. ```sh git clone https://github.com/rilian-la-te/vala-panel-appmenu.git cd vala-panel-appmenu/subprojects/appmenu-glib-translator meson setup build meson install -C build ``` -------------------------------- ### Build and Install astal3 (GTK3) Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Builds and installs the GTK3 version of Astal (`astal3`) after navigating to its directory. Requires dependencies to be installed and the repository to be cloned. ```sh cd lib/astal/gtk3 meson setup build Meson install -C build ``` -------------------------------- ### Install Simple Bar Project Source: https://github.com/aylur/astal/blob/main/examples/gtk4/simple-bar/js/README.md Commands for setting up the build environment and installing the simple bar application system-wide. ```sh meson setup build --wipe meson install -C build simple-bar ``` -------------------------------- ### Build and Install astal4 (GTK4) Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Builds and installs the GTK4 version of Astal (`astal4`) after navigating to its directory. Requires dependencies to be installed and the repository to be cloned. ```sh cd lib/astal/gtk4 meson setup build Meson install -C build ``` -------------------------------- ### Lua Mpris Player Example Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Illustrates the usage of the AstalMpris library in Lua to get information about a media player like Spotify. ```lua local Mpris = require("lgi").require("AstalMpris") local spotify = Mpris.Player.new("spotify") if spotify.available then print(spotify.title) end ``` -------------------------------- ### Install Dependencies for Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Installs necessary build dependencies for Astal on Ubuntu using `apt`. ```sh sudo apt install \ meson valac valadoc gobject-introspection libgirepository1.0-dev \ libgtk-3-dev libgtk-layer-shell-dev \ libgtk-4-dev libgtk4-layer-shell-dev ``` -------------------------------- ### Vala Brightness Library Usage Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Example of using the AstalBrightness library in Vala to get the default brightness instance, print the screen brightness, and set it. ```vala var brightness = AstalBrightness.get_default(); print(@"$(brightness.screen.brightness)\n"); brightness.screen.brightness = 0.5f; ``` -------------------------------- ### Get Hyprland Clients in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Example of how to get and print the titles of all Hyprland clients using the Vala binding. ```vala var hyprland = AstalHyprland.get_default(); foreach (var client in hyprland.clients) { print(client.title); } ``` -------------------------------- ### Install Hyprland Library with Meson Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Builds and installs the Hyprland library using Meson build system. ```sh meson setup build meson install -C build ``` -------------------------------- ### Get Hyprland Clients in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Example of how to get and print the titles of all Hyprland clients using the Python binding. ```py from gi.repository import AstalHyprland as Hyprland hyprland = Hyprland.get_default() for client in hyprland.get_clients(): print(client.get_title()) ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Install necessary dependencies for building Astal on Fedora. ```sh sudo dnf install meson pam-devel gobject-introspection-devel ``` -------------------------------- ### Get Hyprland Clients in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Example of how to get and print the titles of all Hyprland clients using the Lua binding. ```lua local Hyprland = require("lgi").require("AstalHyprland") local hyprland = Hyprland.get_default() for _, c in ipairs(hyprland.clients) do print(c.title) end ``` -------------------------------- ### Get Hyprland Clients in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Example of how to get and print the titles of all Hyprland clients using the JavaScript binding. ```js import Hyprland from "gi://AstalHyprland" const hyprland = Hyprland.get_default() for (const client of hyprland.get_clients()) { print(client.title) } ``` -------------------------------- ### Clone and Build Greet Library Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Clones the Greet library repository and installs it using Meson build system. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/greet meson setup build meson install -C build ``` -------------------------------- ### Start Hyprland Monitoring CLI Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Use the astal-hyprland command to start monitoring the Hyprland socket. ```sh astal-hyprland # starts monitoring ``` -------------------------------- ### Lua Brightness Library Usage Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Example of using the AstalBrightness library in Lua to get the default brightness instance, print the screen brightness, and set it. ```lua local Brightness = require("lgi").require("AstalBrightness") local brightness = Brightness.get_default() print(brightness.screen.brightness) brightness.screen.brightness = 0.5 ``` -------------------------------- ### Install Build Dependencies on Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md Installs essential build tools including meson, valac, valadoc, and gobject-introspection for Ubuntu. ```sh sudo apt install meson valac valadoc gobject-introspection ``` -------------------------------- ### JavaScript Brightness Library Usage Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Example of using the AstalBrightness library in JavaScript to get the default brightness instance, print the screen brightness, and set it. ```js import Brightness from "gi://AstalBrightness" const brightness = Brightness.get_default() print(brightness.screen.brightness)rightness.screen.brightness = 0.5 ``` -------------------------------- ### Install Dependencies on Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Installs necessary build tools and libraries for compiling the Astal Network library on Ubuntu. This includes meson, vala, and NetworkManager development files. ```sh sudo apt install meson valac valadoc libnm-dev gobject-introspection ``` -------------------------------- ### JavaScript Mpris Player Example Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Demonstrates how to initialize and check the availability of a media player like Spotify using the AstalMpris library in JavaScript. ```js import Mpris from "gi://AstalMpris" const spotify = Mpris.Player.new("spotify") if (spotify.available) print(spotify.title) ``` -------------------------------- ### Install Dependencies (Ubuntu) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Installs necessary dependencies for River on Ubuntu. ```sh sudo apt install meson libjson-glib-dev gobject-introspection ``` -------------------------------- ### Python Mpris Player Example Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Shows how to create and interact with a media player instance, such as Spotify, using the AstalMpris library in Python. ```py from gi.repository import AstalMpris as Mpris spotify = Mpris.Player.new("spotify") if spotify.get_available(): print(spotify.get_title()) ``` -------------------------------- ### Install Dependencies for Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Installs necessary build dependencies for Astal on Fedora using `dnf`. ```sh sudo dnf install \ meson vala valadoc gobject-introspection-devel wayland-protocols-devel \ gtk3-devel gtk-layer-shell-devel \ gtk4-devel gtk4-layer-shell-devel ``` -------------------------------- ### Python Brightness Library Usage Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Example of using the AstalBrightness library in Python to get the default brightness instance, retrieve the screen object, print its brightness, and set it. ```py from gi.repository import AstalBrightness as Brightness brightness = Brightness.get_default() screen = brightness.get_screen() print(screen.get_brightness()) screen.set_brightness(0.5) ``` -------------------------------- ### Install Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Install necessary dependencies for building Astal on Arch Linux. ```sh sudo pacman -Syu meson pam gobject-introspection ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Installs necessary dependencies for building on Fedora, including meson, json-glib-devel, and gobject-introspection-devel. ```sh sudo dnf install meson json-glib-devel gobject-introspection-devel ``` -------------------------------- ### Run Cava CLI Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md This is the command to run the Cava command-line interface. No specific setup is required beyond having cava installed. ```sh cava ``` -------------------------------- ### Vala Mpris Player Example Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Provides an example of using the AstalMpris library in Vala to access media player properties like title. ```vala var spotify = AstalMpris.Player.new("spotify") if (spotify.available) print(spotify.title); ``` -------------------------------- ### Greet Library Login - JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Example of logging into greetd using the AstalGreet JavaScript library. Ensure the library is imported before use. ```js import Greet from "gi://AstalGreet" Greet.login("username", "password", "compositor", (_, res) => { try { Greet.login_finish(res) } catch (err) { printerr(err) } }) ``` -------------------------------- ### Install Dependencies (Fedora) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Installs necessary dependencies for River on Fedora. ```sh sudo dnf install meson gcc json-glib-devel gobject-introspection-devel ``` -------------------------------- ### Install Dependencies for Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Installs necessary build dependencies for Astal on Arch Linux using `pacman`. ```sh sudo pacman -Syu \ meson vala valadoc gobject-introspection \ gtk3 gtk-layer-shell \ gtk4 gtk4-layer-shell ``` -------------------------------- ### Install Dependencies (Arch Linux) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Installs necessary dependencies for River on Arch Linux. ```sh sudo pacman -Syu meson json-glib gobject-introspection ``` -------------------------------- ### Install Build Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md Installs necessary build tools including meson, vala, valadoc, and gobject-introspection for Arch Linux. ```sh sudo pacman -Syu meson vala valadoc gobject-introspection ``` -------------------------------- ### Install Build Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md Installs required build tools such as meson, vala, valadoc, and gobject-introspection-devel for Fedora. ```sh sudo dnf install meson vala valadoc gobject-introspection-devel ``` -------------------------------- ### Install Notifd Dependencies on Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This command installs the necessary dependencies for building Notifd on Ubuntu using apt. ```sh sudo apt install meson valac valadoc libgdk-pixbuf-2.0-dev libjson-glib-dev gobject-introspection ``` -------------------------------- ### Install Astal Meta Package with Yay Source: https://github.com/aylur/astal/blob/main/docs/guide/installation.md Use this command to install the `libastal-meta` package on Arch Linux using the `yay` AUR helper. ```sh yay -S libastal-meta ``` -------------------------------- ### Greet Library Login - Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Example of logging into greetd using the AstalGreet Python library. A callback function is used to handle the result. ```py from gi.repository import AstalGreet as Greet def callback(_, res): try Greet.login_finish(res) except Exception as e: print(e) Greet.login("username", "password", "compositor", callback) ``` -------------------------------- ### Get Wi-Fi SSID in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Retrieves the default network interface and prints the Wi-Fi SSID using the Astal Network library in Vala. This example assumes the AstalNetwork library is available in the Vala environment. ```vala var network = AstalNetwork.get_default(); print(network.wifi.ssid); ``` -------------------------------- ### Greet Library Login - Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Example of logging into greetd using the AstalGreet Vala library. This asynchronous operation uses a try-catch block for error handling. ```vala try { yield AstalGreet.login("username", "password", "compositor"); } catch (Error err) { printerr(err.message); } ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Installs necessary build tools and libraries for compiling the Astal Network library on Fedora. This includes meson, vala, and NetworkManager development files. ```sh sudo dnf install meson vala valadoc NetworkManager-libnm-devel gobject-introspection-devel ``` -------------------------------- ### Greet Library Login - Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Example of logging into greetd using the AstalGreet Lua library. The login function takes a callback to process the result. ```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) ``` -------------------------------- ### Develop Simple Bar Project Source: https://github.com/aylur/astal/blob/main/examples/gtk4/simple-bar/js/README.md Commands for setting up the build environment, installing the project locally, and running the simple bar application during development. ```sh meson setup build --wipe --prefix "$(pwd)/result" meson install -C build ./result/bin/simple-bar ``` -------------------------------- ### Install Hyprland Dependencies on Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Installs necessary dependencies for Hyprland development on Ubuntu using apt. ```sh sudo apt install meson valac valadoc libjson-glib-dev gobject-introspection ``` -------------------------------- ### Install Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Installs necessary build tools and libraries for compiling the Astal Network library on Arch Linux. This includes meson, vala, and NetworkManager development files. ```sh sudo pacman -Syu meson vala valadoc libnm gobject-introspection ``` -------------------------------- ### Install Mpris Dependencies on Ubuntu Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Installs the necessary build dependencies for Mpris on Ubuntu using apt. ```sh sudo apt install meson valac valadoc gvfs libjson-glib-dev gobject-introspection ``` -------------------------------- ### Install Notifd Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This command installs the required dependencies for building Notifd on Fedora using dnf. ```sh sudo dnf install meson vala valadoc gdk-pixbuf2-devel json-glib-devel gobject-introspection-devel ``` -------------------------------- ### Install Hyprland Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Installs necessary dependencies for Hyprland development on Fedora using dnf. ```sh sudo dnf install meson vala valadoc json-glib-devel gobject-introspection-devel ``` -------------------------------- ### Query Apps in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Provides an example of querying applications using the Astal Apps library in Vala. ```vala 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); } ``` -------------------------------- ### Get Default Tray and List Item Titles in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Demonstrates how to get the default tray instance and iterate through its items to print their titles using Vala. ```vala var tray = AstalTray.get_default(); foreach (var item in tray.get_items()) { print(item.title); } ``` -------------------------------- ### Install Notifd Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This command installs the necessary dependencies for building Notifd on Arch Linux using pacman. ```sh sudo pacman -Syu meson vala valadoc gdk-pixbuf2 json-glib gobject-introspection ``` -------------------------------- ### Install libcava on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md Installs necessary build tools and the libcava dependency on Arch Linux using pacman and paru. ```sh sudo pacman -Syu meson vala gobject-introspection paru -S libcava ``` -------------------------------- ### Install Mpris Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Installs the required packages for Mpris development on Fedora using dnf. ```sh sudo dnf install meson vala valadoc gvfs json-glib-devel gobject-introspection-devel ``` -------------------------------- ### Install Hyprland Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Installs necessary dependencies for Hyprland development on Arch Linux using pacman. ```sh sudo pacman -Syu meson vala valadoc json-glib gobject-introspection ``` -------------------------------- ### Install Wireplumber Dependencies on Fedora Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Installs required development packages for Wireplumber integration on Fedora using dnf. ```sh sudo dnf install meson vala valadoc wireplumber-devel gobject-introspection-devel ``` -------------------------------- ### Install Mpris Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Installs the necessary dependencies for building Mpris on Arch Linux using pacman. ```sh sudo pacman -Syu meson vala valadoc gvfs json-glib gobject-introspection ``` -------------------------------- ### Get Battery Percentage in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Demonstrates how to get the default battery percentage using the AstalBattery library in JavaScript. Requires importing the AstalBattery module. ```js import Battery from "gi://AstalBattery" const battery = Battery.get_default() print(battery.percentage) ``` -------------------------------- ### Get Default Tray and List Item Titles in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Demonstrates how to get the default tray instance and iterate through its items to print their titles using JavaScript. ```js import Tray from "gi://AstalTray" const tray = Tray.get_default() for (const item of tray.get_items()) { print(item.title) } ``` -------------------------------- ### Get Default Tray and List Item Titles in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Demonstrates how to get the default tray instance and iterate through its items to print their titles using Lua. ```lua local Tray = require("lgi").require("AstalTray") local tray = Tray.get_default() for _, i in ipairs(tray.items) do print(i.title) end ``` -------------------------------- ### Get Default Tray and List Item Titles in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Demonstrates how to get the default tray instance and iterate through its items to print their titles using Python. ```py from gi.repository import AstalTray as Tray tray = Tray.get_default() for item in tray.get_items(): print(item.title) ``` -------------------------------- ### Install Wireplumber Dependencies on Arch Linux Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Installs necessary development packages for Wireplumber integration on Arch Linux using pacman. ```sh sudo pacman -Syu meson vala valadoc wireplumber gobject-introspection ``` -------------------------------- ### Get Battery Percentage in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Shows how to retrieve the default battery percentage using the AstalBattery library in Python. Requires importing the AstalBattery module from gi.repository. ```py from gi.repository import AstalBattery as Battery battery = Battery.get_default() print(battery.get_percentage()) ``` -------------------------------- ### Get Default River Instance (Vala) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Retrieves the default River instance and iterates over its outputs in Vala. ```vala var river = AstalRiver.get_default(); foreach (var output in river.get_outputs()) { print(output.name); } ``` -------------------------------- ### Query Apps in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Demonstrates how to initialize the Apps library in JavaScript and perform a fuzzy query for applications. ```js import Apps from "gi://AstalApps" const apps = new Apps.Apps({ nameMultiplier: 2, entryMultiplier: 0, executableMultiplier: 2, }) for (const app of apps.fuzzy_query("spotify")) { print(app.name) } ``` -------------------------------- ### Showcase File Structure Source: https://github.com/aylur/astal/blob/main/docs/README.md Illustrates the directory structure for adding showcase images and information. ```bash .\n├── public/showcase\n│ └── your-name-optional-title.webp # 1. add image\n└── showcases/\n └── showcases.ts # 2. add information ``` -------------------------------- ### Get Bluetooth Device Names in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md This snippet shows how to get the default Bluetooth adapter and iterate over its devices to print their names using the AstalBluetooth library in JavaScript. ```javascript import Bluetooth from "gi://AstalBluetooth" const bluetooth = Bluetooth.get_default() for (const device of bluetooth.get_devices()) { print(device.name) } ``` -------------------------------- ### Get Default River Instance (Python) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Retrieves the default River instance and iterates over its outputs in Python. ```py from gi.repository import AstalRiver as River river = River.get_default() for output in river.get_outputs(): print(output.get_name()) ``` -------------------------------- ### Get Battery Percentage in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Demonstrates fetching the default battery percentage using the AstalBattery library in Vala. The percentage is printed using string interpolation. ```vala var battery = AstalBattery.get_default(); print(@"$(battery.percentage)\n"); ``` -------------------------------- ### Access Default Speaker Volume in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Provides an example in Vala for accessing the default speaker and its volume through the AstalWp library. Similar to JavaScript, it uses direct property access. ```vala var wp = AstalWp.get_default(); var default_speaker = wp.audio.default_speaker; print(default_speaker.volume); ``` -------------------------------- ### Get Default River Instance (JavaScript) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Retrieves the default River instance and iterates over its outputs in JavaScript. ```js import River from "gi://AstalRiver" const river = River.get_default() for (const output of river.get_outputs()) { print(output.name) } ``` -------------------------------- ### Get Default River Instance (Lua) Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Retrieves the default River instance and iterates over its outputs in Lua. ```lua local River = require("lgi").require("AstalRiver") local river = River.River.get_default() for _, o in ipairs(river.outputs) do print(o.name) end ``` -------------------------------- ### Get Active Power Profile in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Retrieves and prints the active power profile using the PowerProfiles library in Python. ```py from gi.repository import AstalPowerProfiles as PowerProfiles powerprofiles = PowerProfiles.get_default() print(powerprofiles.get_active_profile()) ``` -------------------------------- ### Get Bluetooth Device Names in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md This snippet demonstrates how to obtain the default Bluetooth adapter and loop through its devices to print their names using the AstalBluetooth library in Python. ```python from gi.repository import AstalBluetooth as Bluetooth bluetooth = Bluetooth.get_default() for device in bluetooth.get_devices(): print(device.get_name()) ``` -------------------------------- ### Access Default Speaker Volume in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Demonstrates how to get the default speaker object and print its volume using the AstalWp library in JavaScript. Assumes the library has loaded data. ```js import Wp from "gi://AstalWp" const wp = Wp.get_default() const default_speaker = wp.audio.default_speaker print(default_speaker.volume) ``` -------------------------------- ### Get Active Power Profile in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Retrieves and prints the active power profile using the PowerProfiles library in Vala. ```vala var powerprofiles = AstalPowerProfiles.get_default(); print(powerprofiles.activeProfile); ``` -------------------------------- ### Get Active Power Profile in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Retrieves and prints the active power profile using the PowerProfiles library in Lua. ```lua local PowerProfiles = require("lgi").require("AstalPowerProfiles") local powerprofiles = PowerProfiles.get_default() print(powerprofiles.active_profile) ``` -------------------------------- ### Get Active Power Profile in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Retrieves and prints the active power profile using the PowerProfiles library in JavaScript. ```js import PowerProfiles from "gi://AstalPowerProfiles" const powerprofiles = PowerProfiles.get_default() print(powerprofiles.activeProfile) ``` -------------------------------- ### Get Battery Percentage in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Illustrates how to obtain the default battery percentage using the AstalBattery library in Lua. Requires requiring the 'AstalBattery' module via 'lgi'. ```lua local Battery = require("lgi").require("AstalBattery") local battery = Battery.get_default() print(battery.percentage) ``` -------------------------------- ### Preview Production Build Locally Source: https://github.com/aylur/astal/blob/main/docs/README.md Allows you to preview the production build locally before deployment. ```bash npm run preview ``` -------------------------------- ### Get Bluetooth Device Names in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md This snippet illustrates how to access the default Bluetooth adapter and iterate through its devices to display their names using the AstalBluetooth library in Lua. ```lua local Bluetooth = require("lgi").require("AstalBluetooth") local bluetooth = Bluetooth.get_default() for _, d in ipairs(bluetooth.devices) do print(d.name) end ``` -------------------------------- ### Lua CLI Argument Parsing with Quarrel Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/quarrel.md Example of using Quarrel in Lua to build a CLI application with subcommands and options. Demonstrates defining flags, string options, and argument parsing. ```lua local Quarrel = require("lgi").require("Quarrel") local help = Quarrel.Flag.new("help", string.byte("h"), "Print this help") local greeting = Quarrel.StringOpt.new( "greeting", string.byte("g"), "Greeting [default: 'Greeting']" ) local greet = Quarrel.Command.new("greet") :about("Greeter subcommand") :arg("NAME", "Positional argument") :opt(greeting):opt(help) local cli = Quarrel.Command.new("hello") :about("My Awesome CLI") :subcommand(greet) :arg("NAME", "Positional argument") :opt(help) local argv = { arg[0] } for i = 1, #arg do table.insert(argv, arg[i]) end local command = cli:parse(argv) if command == cli then if help.value or #cli.args == 0 then print(Quarrel.help(cli)) os.exit(1) end local name = cli.args[1] print(string.format("Hello %s!", name or "unknown")) end if command == greet then if help.value or #greet.args == 0 then print(Quarrel.help(greet)) os.exit(1) end local name = greet.args[1] print(string.format("%s %s!", greeting.value or "Greeting", name or "unknown")) end ``` -------------------------------- ### Access Default Speaker Volume in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Illustrates fetching the default speaker's volume via the AstalWp library in Lua. This example uses direct property access. ```lua local Wp = require("lgi").require("AstalWp") local audio = Wp.get_default().audio print(audio.default_speaker.volume) ``` -------------------------------- ### Get Bluetooth Device Names in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md This snippet shows how to retrieve the default Bluetooth adapter and iterate over its devices to print their names using the AstalBluetooth library in Vala. ```vala var bluetooth = AstalBluetooth.get_default(); foreach (var device in bluetooth.get_devices()) { print("%s\n", device.name); } ``` -------------------------------- ### Greet CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/greet.md Displays the help message for the astal-greet command-line interface. ```sh astal-greet --help ``` -------------------------------- ### Nix Derivation with Meson for TypeScript Source: https://github.com/aylur/astal/blob/main/docs/guide/nix.md Use this Nix derivation when integrating with TypeScript projects that utilize esbuild and require meson for installing data files. Ensure meson, ninja, and pkg-config are included in nativeBuildInputs. ```nix { nativeBuildInputs = [ pkgs.wrapGAppsHook3 pkgs.gobject-introspection pkgs.esbuild pkgs.meson # [!code ++] pkgs.ninja # [!code ++] pkgs.pkg-config # [!code ++] ]; } ``` -------------------------------- ### Get Wi-Fi SSID in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Retrieves the default network interface and prints the Wi-Fi SSID using the Astal Network library in JavaScript. Ensure the AstalNetwork library is imported. ```js import Network from "gi://AstalNetwork" const network = Network.get_default() print(network.wifi.ssid) ``` -------------------------------- ### Get Wi-Fi SSID in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Retrieves the default network interface and prints the Wi-Fi SSID using the Astal Network library in Python. The NetworkManager-libnm-devel package is required for this functionality. ```py from gi.repository import AstalNetwork as Network network = Network.get_default() print(network.get_wifi().get_ssid()) ``` -------------------------------- ### Build Production Site Source: https://github.com/aylur/astal/blob/main/docs/README.md Builds the project for production deployment, outputting to the './dist/' directory. ```bash npm run build ``` -------------------------------- ### Get Wi-Fi SSID in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Retrieves the default network interface and prints the Wi-Fi SSID using the Astal Network library in Lua. This requires the lgi package and the AstalNetwork module. ```lua local Network = require("lgi").require("AstalNetwork") local network = Network.get_default() print(network.wifi.ssid) ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Clones the Astal repository and changes the directory to the apps library. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/apps ``` -------------------------------- ### Show CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Displays the help message for the astal-apps command-line interface. ```sh astal-apps --help ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Clones the astal repository and changes the directory to the powerprofiles library. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/powerprofiles ``` -------------------------------- ### Configure PAM Service on NixOS Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Add the 'astal-auth' service to PAM configuration on NixOS. ```nix { security.pam.services.astal-auth = {} } ``` -------------------------------- ### Brightness CLI Operations Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Demonstrates common operations using the astal-brightness CLI, including listing devices, setting brightness to a percentage, adjusting brightness by a percentage, and monitoring changes. ```sh astal-brightness list --pretty astal-brightness set 50% astal-brightness set +10% astal-brightness monitor ``` -------------------------------- ### Query Apps in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Illustrates using the Astal Apps library with Lua to find applications. ```lua local Apps = require("lgi").require("AstalApps") local apps = Apps.Apps({ name_multiplier = 2, entry_multiplier = 0, executable_multiplier = 2, }) for _, app in ipairs(apps:fuzzy_query("lutris")) do print(app.name) end ``` -------------------------------- ### Display CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/powerprofiles.md Shows the help message for the astal-power-profiles CLI tool. ```sh astal-power-profiles --help ``` -------------------------------- ### Display CLI Help for Tray Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Shows how to display the help message for the astal-tray command-line interface. ```sh astal-tray --help ``` -------------------------------- ### Query Apps in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/apps.md Shows how to use the Astal Apps library in Python to query for applications by name. ```py from gi.repository import AstalApps as Apps apps = Apps.Apps( name_multiplier=2, entry_multiplier=0, executable_multiplier=2, ) for app in apps.fuzzy_query("obsidian"): print(app.get_name()) ``` -------------------------------- ### Clone and Build Astal Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Clone the Astal repository and build the authentication library. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/auth meson setup build meson install -C build ``` -------------------------------- ### CLI Help for NetworkManager Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Displays the help information for the nmcli command-line tool. This is used for interacting with NetworkManager directly. ```sh nmcli --help ``` -------------------------------- ### Clone Repository and Navigate to Bluetooth Library Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/bluetooth.md Clones the Astal repository from GitHub and changes the directory to the lib/bluetooth subdirectory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/bluetooth ``` -------------------------------- ### Display Brightness CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/brightness.md Shows the help message for the astal-brightness CLI tool. ```sh astal-brightness --help ``` -------------------------------- ### Nix flake.nix for Vala Project Source: https://github.com/aylur/astal/blob/main/docs/guide/nix.md This Nix flake configuration is for a Vala project. It includes Astal packages and sets up the build process using meson, ninja, and pkg-config. Additional packages can be added to buildInputs. ```nix { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; astal = { url = "github:aylur/astal"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, astal }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; in { packages.${system}.default = pkgs.stdenv.mkDerivation { # [!code focus:19] name = "my-shell"; src = ./.; nativeBuildInputs = with pkgs; [ meson ninja pkg-config vala gobject-introspection ]; buildInputs = [ astal.packages.${system}.io astal.packages.${system}.astal3 astal.packages.${system}.battery # add extra packages ]; }; }; } ``` -------------------------------- ### Connect to Notifd Daemon in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This Lua snippet demonstrates connecting to the default Notifd daemon and setting up a callback for 'notified' signals. It prints the body and summary of notifications. ```lua local Notifd = require("lgi").require("AstalNotifd") local notifd = Notifd.get_default() notifd.on_notified = function(_, id) local n = notifd:get_notification(id) print(n.body, n.summary) end ``` -------------------------------- ### Clone Tray Library Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/tray.md Clones the astal repository and navigates to the lib/tray directory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/tray ``` -------------------------------- ### Connect to Notifd Daemon in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This JavaScript snippet demonstrates how to connect to the default Notifd daemon and listen for 'notified' signals. It prints the summary and body of received notifications. ```js import Notifd from "gi://AstalNotifd" const notifd = Notifd.get_default() notifd.connect("notified", (_, id) => { const n = notifd.get_notification(id) print(n.summary, n.body) }) ``` -------------------------------- ### Connect to Cava Default Instance in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md Connects to the default Cava instance and sets up a callback for 'values' notifications. Requires the AstalCava GObject. ```py from gi.repository import AstalCava as Cava cava = Cava.get_default() def callback(self, pspec): print(cava.get_values()) cava.connect("notify::values", callback) ``` -------------------------------- ### Authenticate with CLI Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Use the astal-auth CLI tool to authenticate with a password. ```sh astal-auth --password my-password ``` -------------------------------- ### JavaScript CLI Argument Parsing with Quarrel Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/quarrel.md Demonstrates how to define commands, options, and arguments for a CLI application using Quarrel in JavaScript. Includes parsing and handling of help flags and positional arguments. ```javascript import { programInvocationName, programArgs, exit } from "system" import Quarrel from "gi://Quarrel" const help = Quarrel.Flag.new("help", "h".charCodeAt(0), "Print this help") const greeting = Quarrel.StringOpt.new( "greeting", "g".charCodeAt(0), "Greeting [default: 'Greeting']", ) const greet = Quarrel.Command.new("greet") .about("Greeter subcommand") .arg("NAME", "Positional argument") .opt(greeting) .opt(help) const cli = Quarrel.Command.new("hello") .about("My Awesome CLI") .subcommand(greet) .arg("NAME", "Positional argument") .opt(help) const command = cli.parse([programInvocationName, ...programArgs]) if (command === cli) { if (help.value || cli.args.length === 0) { print(Quarrel.help(cli)) exit(1) } const [name] = cli.args print(`Hello ${name ?? "unknown"}!`) } if (command === greet) { if (help.value || greet.args.length === 0) { print(Quarrel.help(greet)) exit(1) } const [name] = greet.args print(`${greeting.value ?? "Greeting"} ${name ?? "unknown"}!`) } ``` -------------------------------- ### Vala CLI Argument Parsing with Quarrel Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/quarrel.md Illustrates how to use Quarrel in Vala to create a command-line interface with subcommands and options. Covers defining flags, string options, and parsing arguments. ```vala int main(string[] args) { var help = new Quarrel.Flag("help", 'h', "Print this help"); var greeting = new Quarrel.StringOpt( "greeting", 'g', "Greeting [default: 'Greeting']" ); var greet = new Quarrel.Command("greet") .about("Greeter subcommand") .arg("NAME", "Positional argument") .opt(greeting) .opt(help); var cli = new Quarrel.Command("hello") .about("My Awesome CLI") .subcommand(greet) .arg("NAME", "Positional argument") .opt(help); var command = cli.parse(args); if (command == cli) { if (help.value || cli.args.length == 0) { print("%s\n", Quarrel.help(cli)); return 1; } var name = cli.args[0]; print("Hello %s\n", name ?? "unknown"); } if (command == greet) { if (help.value || greet.args.length == 0) { print("%s\n", Quarrel.help(greet)); return 1; } var name = greet.args[0]; print("%s %s\n", greeting.value ?? "Greeting", name ?? "unknown"); } return 0; } ``` -------------------------------- ### Connect to Cava Default Instance in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md Connects to the default Cava instance and sets up a signal handler for 'values' notifications. Requires the AstalCava library. ```vala var cava = AstalCava.get_default(); cava.notify["values"].connect(() => { foreach (var value in cava.values) { print(value); } }); ``` -------------------------------- ### Connect to Cava Default Instance in JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md Connects to the default Cava instance and listens for 'values' notifications. Requires the AstalCava GObject. ```js import Cava from "gi://AstalCava" const cava = Cava.get_default() cava.connect("notify::values", () => { print(cava.get_values()) }) ``` -------------------------------- ### Display Battery Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Shows how to display the help message for the astal-battery CLI tool. ```sh astal-battery --help ``` -------------------------------- ### Python CLI Argument Parsing with Quarrel Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/quarrel.md Shows how to implement a CLI with subcommands and options using Quarrel in Python. Covers defining flags, string options, and parsing command-line arguments. ```python import sys from gi.repository import Quarrel help = Quarrel.Flag.new("help", ord("h"), "Print this help") greeting = Quarrel.StringOpt.new( "greeting", ord("g"), "Greeting [default: 'Greeting']", ) greet = ( Quarrel.Command.new("greet") .about("Greeter subcommand") .arg("NAME", "Positional argument") .opt(greeting) .opt(help) ) cli = ( Quarrel.Command.new("hello") .about("My Awesome CLI") .subcommand(greet) .arg("NAME", "Positional argument") .opt(help) ) command = cli.parse(sys.argv) if command == cli: if help.value or len(cli.get_args()) == 0: print(Quarrel.help(cli)) sys.exit(1) name = cli.get_args()[0] print(f"Hello {name or 'unknown'}!") if command == greet: if help.value or len(greet.get_args()) == 0: print(Quarrel.help(greet)) sys.exit(1) name = greet.get_args()[0] print(f"{greeting.value or 'Greeting'} {name or 'unknown'}!") ``` -------------------------------- ### Connect to Notifd Daemon in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This Python snippet shows how to connect to the default Notifd daemon and handle 'notified' signals. It retrieves and prints the body of incoming notifications. ```py from gi.repository import AstalNotifd as Notifd notifd = Notifd.get_default() def on_notified(_, id): n = notifd.get_notification(id) print(n.get_body(), n.get_body()) notifd.connect("notified", on_notified) ``` -------------------------------- ### Wireplumber CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Access the help information for the wireplumber command-line interface. ```sh wpctl --help ``` -------------------------------- ### Connect to Notifd Daemon in Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md This Vala snippet shows how to connect to the default Notifd daemon and attach a handler for the 'notified' signal. It prints the summary and body of received notifications. ```vala var notifd = AstalNotifd.get_default(); notifd.notified.connect((_, id) => { var n = notifd.get_notification(id); print("%s %s\n", n.summary, n.body); }) ``` -------------------------------- ### Display Notifd Help Information Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md Use this command to view the help message and available options for the astal-notifd CLI tool. ```sh astal-notifd --help ``` -------------------------------- ### River CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Displays the help message for the astal-river CLI tool. ```sh astal-river --help ``` -------------------------------- ### Clone Hyprland Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/hyprland.md Clones the Astal Hyprland repository and navigates into the library directory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/hyprland ``` -------------------------------- ### Authenticate with Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Authenticate using the Astal Pam library in Python. Requires the AstalAuth GObject introspection. ```py from gi.repository import AstalAuth as Auth def callback(_, task) -> None: try: Auth.Pam.authenticate_finish(task) print("success") except Exception as e: print(e) Auth.Pam.authenticate("password", callback) ``` -------------------------------- ### Mpris CLI Help Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Displays the help message for the astal-mpris command-line interface. ```sh astal-mpris --help ``` -------------------------------- ### Clone Astal Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/network.md Clones the Astal project repository from GitHub and navigates into the network library directory. This is the first step in building the library from source. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/network ``` -------------------------------- ### Clone and Navigate to Mpris Directory Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Clones the astal repository and changes the directory to the mpris library. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/mpris ``` -------------------------------- ### Clone River Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/river.md Clones the River repository and navigates into the library directory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/river ``` -------------------------------- ### Clone Notifd Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/notifd.md Clone the astal repository to access the Notifd library and navigate into its directory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/notifd ``` -------------------------------- ### Clone and Navigate to Quarrel Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/quarrel.md Clones the Quarrel library repository and changes the directory to its location. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/quarrel ``` -------------------------------- ### Clone Astal Repository Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/battery.md Clones the Astal project repository from GitHub and navigates into the lib/battery directory. ```sh git clone https://github.com/aylur/astal.git cd astal/lib/battery ``` -------------------------------- ### Authenticate with JavaScript Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Authenticate using the Astal Pam library in JavaScript. Requires the AstalAuth GObject introspection. ```js import Auth from "gi://AstalAuth" Auth.Pam.authenticate("password", (_, task) => { try { AstalAuth.Pam.authenticate_finish(task) print("authentication sucessful") } catch (error) { print(error) } }) ``` -------------------------------- ### Access Default Speaker Volume in Python Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/wireplumber.md Shows how to retrieve the default speaker and its volume using the AstalWp library in Python. This method uses getter functions for properties. ```py from gi.repository import AstalWp as Wp audio = Wp.get_default().get_audio() print(audio.get_default_speaker().get_volume()) ``` -------------------------------- ### Authenticate with Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Authenticate using the Astal Pam library in Lua. Requires the AstalAuth GObject introspection. ```lua local Auth = require("lgi").require("AstalAuth") Auth.Pam.authenticate("password", function(_, task) local status, err = Auth.Pam.authenticate_finish(task) if err ~= nil then print(err) else print("success") end end) ``` -------------------------------- ### Authenticate with Vala Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/auth.md Authenticate using the Astal Pam library in Vala. Requires the AstalAuth GObject introspection. ```vala AstalAuth.Pam.authenticate.begin("password", (_, task) => { try { AstalAuth.Pam.authenticate.end(task); print("authentication sucessful\n"); } catch (Error error) { print(error.message); } }); ``` -------------------------------- ### Connect to Cava Default Instance in Lua Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/cava.md Connects to the default Cava instance and registers a handler for 'values' notifications. Requires the AstalCava LGI binding. ```lua local Cava = require("lgi").require("AstalCava") local cava = Cava.get_default() cava.on_notify.values = function() print(cava.values) end ``` -------------------------------- ### Enable gvfs in NixOS Configuration Source: https://github.com/aylur/astal/blob/main/docs/guide/libraries/mpris.md Enables the gvfs service in NixOS configuration.nix, which is required for caching network cover art URLs. ```nix services.gvfs.enable = true; ```