# UKUI Power Manager

[中文版](README_zh.md)

UKUI Power Manager is a session daemon for the UKUI desktop that manages system power-related events and triggers appropriate actions. It provides a user-friendly interface for battery status monitoring, brightness control, power saving settings, and sleep/shutdown management.

## Features

- Battery status display and management
- Display brightness control
- CPU, GPU, and HDD power saving
- Suspend-to-RAM, hibernate, and shutdown triggers
- System tray integration
- D-Bus service for privilege escalation

## Build Dependencies

- Qt 6 (qt6-base-dev, qt6-base-dev-tools, qt6-l10n-tools, qmake6)
- libglib2.0-dev
- libgsettings-qt6-dev
- libkf6windowsystem-dev
- libkysdk-applications-dev, libkysdk-base-dev, libkysdk-system-dev
- libpci-dev
- libukcc-dev
- libukui-log4qt-dev
- libupower-glib-dev
- libx11-dev, libxext-dev, libxrandr-dev
- libxml-parser-perl
- pkgconf
- debhelper-compat (= 13)

## Building from Source

```bash
mkdir build
cd build
qmake6 ..
make -j$(nproc)
sudo make install
```

After installation, restart the D-Bus service or reboot for changes to take effect:

```bash
# Call exitService interface to restart
# or simply reboot the system
```

## Debian Packaging

This project supports Debian packaging with [git-buildpackage](https://honk.sigxcpu.org/projects/git-buildpackage/) and Salsa CI.

```bash
# Build the Debian package
gbp buildpackage

# Import a new upstream release
gbp import-orig --pristine-tar ../ukui-power-manager_<version>.orig.tar.gz
```

## Project Structure

```
ukui-power-manager/
├── 3rd/                        # Third-party libraries (TLP)
├── data/                       # D-Bus service files, schemas, icons
├── debian/                     # Debian packaging files
├── man/                        # Manual pages
├── plugin-power/               # Power plugin module
├── power/                      # Core power management library
├── PowerManagementDaemon/      # Power management daemon
├── registeredQDbus/            # D-Bus registration
├── shared/                     # Shared utilities
├── tests/                      # Test suite
├── ukui-power-manager/         # Main application
├── ukui-power-manager-tray/    # System tray application
├── ukui-upower/                # UPower integration
└── powermanagement.pro         # Top-level qmake project file
```

## License

This project is licensed under the GPL-3.0-or-later license. See [COPYING](COPYING) for details.

## Links

- Homepage: <https://gitee.com/openkylin/ukui-power-manager>
- Bug Tracker: <https://gitee.com/openkylin/ukui-power-manager/issues>
- Salsa: <https://salsa.debian.org/kylin-team/ukui-power-manager>
