npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vasakgroup/plugin-power-profiles

v2.0.0

Published

A Tauri plugin to read and change the power profile (power-profiles-daemon) over D-Bus on Linux.

Readme

tauri-plugin-power-profiles

Plugin de Tauri para leer y cambiar el perfil de energía del equipo (power-saver, balanced, performance) a través de power-profiles-daemon por D-Bus, con un evento cuando el perfil cambia.

Es parte de VasakOS: lo usan vasak-settings y el centro de control de vasak-desktop. Sólo Linux.

Cómo funciona, y por qué es barato

  • Una sola lectura. Al arrancar —en segundo plano, sin demorar la ventana— el plugin hace un GetAll de la interfaz del demonio y guarda el resultado. get_power_state devuelve esa copia: abrir el selector no va al bus.
  • Señales, no sondeo. La copia se mantiene con PropertiesChanged (el perfil cambió desde otra aplicación, o el demonio limitó el rendimiento por temperatura) y NameOwnerChanged (el demonio se instaló, arrancó o se cayó). Cada cambio real se emite como el evento power-profile-changed.
  • Sin subprocesos. Todo es D-Bus por zbus.
  • Los dos nombres del demonio. Desde la 0.20 se publica como org.freedesktop.UPower.PowerProfiles y mantiene net.hadess.PowerProfiles por compatibilidad. El plugin prueba el nuevo primero y cae al viejo.
  • Sin demonio no es un error. get_power_state devuelve available: false y la interfaz lo muestra «no disponible».

Instalación

# src-tauri/Cargo.toml
[dependencies]
tauri-plugin-power-profiles = "2"
bun add @vasakgroup/plugin-power-profiles
tauri::Builder::default()
    .plugin(tauri_plugin_power_profiles::init())

Y en la capacidad de la ventana:

"permissions": ["power-profiles:default"]

power-profiles:default permite los dos comandos. Escuchar el evento usa el permiso core:event:default, que ya viene en core:default.

Uso

import {
  getPowerState,
  setPowerProfile,
  onPowerStateChanged,
} from '@vasakgroup/plugin-power-profiles';

const state = await getPowerState();
// { available: true, profiles: ['power-saver', 'balanced', 'performance'],
//   activeProfile: 'balanced', performanceDegraded: null }

await setPowerProfile('power-saver'); // devuelve el estado nuevo

const unlisten = await onPowerStateChanged((next) => {
  console.log(next.activeProfile);
});

| Comando | Devuelve | Notas | |---|---|---| | get_power_state | PowerState | De la copia; no va al bus. | | set_power_profile(profile) | PowerState | Falla si el perfil no está en profiles o si no hay demonio. |

performanceDegraded trae la razón que da el demonio cuando limita el perfil de rendimiento (lap-detected, high-operating-temperature), o null.

Desde Rust, el mismo gestor está en app.power_profiles() (trait PowerProfilesExt).

Pruebas

cargo test       # incluye las de bus: levantan un dbus-daemon privado con un demonio de mentira
bun run test     # el binding de JavaScript

Las pruebas de bus no tocan el demonio de la máquina: arrancan su propio dbus-daemon y publican ahí un power-profiles-daemon de mentira, con el nombre nuevo o con el viejo, para probar la lectura, el cambio de perfil, un cambio hecho desde afuera y el demonio que se va y vuelve. Si no hay dbus-daemon, lo dicen y no fallan.

Licencia

GPL-3.0-or-later.