Power Profiles
Library and CLI tool for monitoring upowerd powerprofiles.
Usage
You can browse the PowerProfiles reference.
CLI
sh
astal-power-profiles --help
Library
js
import PowerProfiles from "gi://AstalPowerProfiles"
const powerprofiles = PowerProfiles.get_default()
print(powerprofiles.activeProfile)
py
from gi.repository import AstalPowerProfiles as PowerProfiles
powerprofiles = PowerProfiles.get_default()
print(powerprofiles.get_active_profile())
lua
local PowerProfiles = require("lgi").require("AstalPowerProfiles")
local powerprofiles = PowerProfiles.get_default()
print(powerprofiles.active_profile)
vala
// Not yet documented
Installation
- install dependencies
sh
sudo pacman -Syu meson vala json-glib gobject-introspection
sh
sudo dnf install meson vala valadoc json-glib-devel gobject-introspection-devel
sh
sudo apt install meson valac libjson-glib-dev gobject-introspection
INFO
Although UPower is not a direct build dependency, it should be self-explanatory that the daemon is required to be available at runtime.
- clone repo
sh
git clone https://github.com/aylur/astal.git
cd astal/lib/powerprofiles
- install
sh
meson setup --prefix /usr build
meson install -C build