You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LordMZTE 2f063145c7
docs: add manpages
2 months ago
img feat: add README 7 months ago
libs feat: switch to lightweight ini config format 2 months ago
man docs: add manpages 2 months ago
src fix: close config file again 2 months ago
.gitignore initial commit 7 months ago
.gitmodules feat: switch to lightweight ini config format 2 months ago
LICENSE chore: add license 7 months ago
README.md feat: switch to lightweight ini config format 2 months ago
build.zig feat: switch to lightweight ini config format 2 months ago

README.md

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: ¯\_(ツ)_/¯