Skip to content

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

  1. 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.

  1. clone repo
sh
git clone https://github.com/aylur/astal.git
cd astal/lib/powerprofiles
  1. install
sh
meson setup --prefix /usr build
meson install -C build

Released under the LGPL v2.1 License