gpower2/README.md

1.1 KiB

gpower2

A power dialog written in zig using GTK4.

screenshot

Configuration

gpower2 uses a config file located at $XDG_CONFIG_HOME/gpower/config.ini. This file configures how gpower2 will execute actions when a button is clicked.

This is the default config:

[commands]
shutdown = systemctl poweroff
reboot = systemctl reboot
suspend = systemctl suspend
hibernate = systemctl hibernate

This config will be used if the config file can't be opened. If a value is omitted, gpower2 will use the default.

Example custom config to activate i3lock before suspend/hibernate:

[commands]
suspend = sh -c 'i3lock -c 660000 && systemctl suspend'
hibernate = sh -c 'i3lock -c 660000 && systemctl hibernate'

Dependencies

gpower2 requires only a zig compiler and gtk4 to build.

Also note that it uses systemctl to execute actions be default, but this can be changed in the config.

Building

The usual zig way, zig build.

For release builds, use zig build -Drelease-fast.

Installation

Arch Linux: gpower2-git AUR package

Other: ¯\_(ツ)_/¯