Skip to content

CLOUDPIXEL-LAB/PowerNotification-Rust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power Notification

CLOUDWERX LAB Logo

By CLOUDWERX LAB | Digital Food for the Analog Soul

A lightweight Rust application that monitors AC power status and displays desktop notifications on Linux.


Contact: mail@cloudwerx.dev
Website: http://cloudwerx.dev

Features

  • System tray icon that reflects power status
  • Desktop notifications with sound when power is plugged/unplugged
  • Right-click menu with status display and controls
  • Minimal resource usage
  • Silent background monitoring

Requirements

  • Linux with /sys/class/power_supply support
  • D-Bus notification daemon
  • System tray (tested on Cinnamon, should work on GNOME, KDE, XFCE)

Installation

Prerequisites

You'll need to install Rust if you don't have it already:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then activate the Rust environment:

source $HOME/.cargo/env

Verify installation:

rustc --version
cargo --version

From Source

cargo build --release
mkdir -p ~/.local/bin
cp target/release/power-notification ~/.local/bin/

Auto-start on Login

Create ~/.config/autostart/power-notification.desktop:

[Desktop Entry]
Type=Application
Name=Power Notification
Exec=/home/YOUR_USERNAME/.local/bin/power-notification
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true

Replace YOUR_USERNAME with your actual username.

Usage

Run the application:

power-notification

Or run in background:

power-notification &

System Tray Menu

Right-click the tray icon to:

  • View current power status
  • Test notifications
  • Exit the application

Build from Source

cargo build --release

Technical Details

  • Monitors /sys/class/power_supply for AC adapter status changes
  • Polls every 2 seconds for power state changes
  • Uses D-Bus for desktop notifications
  • Graceful error handling if power supply interface is unavailable
  • Works without icon themes (uses generic system icons)

License

Apache License 2.0

Copyright © 2026 CLOUDWERX LAB

For license details, see the LICENSE file.

About

Lightweight Rust application that monitors AC power status and displays desktop notifications on Linux with system tray integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%