LordMZTE 9781ef0acb
feat: switch to lightweight ini config format
2022-09-27 18:27:36 +02:00
img feat: add README 2022-05-16 15:09:15 +02:00
libs feat: switch to lightweight ini config format 2022-09-27 18:27:36 +02:00
src feat: switch to lightweight ini config format 2022-09-27 18:27:36 +02:00
.gitignore initial commit 2022-05-16 15:01:42 +02:00
.gitmodules feat: switch to lightweight ini config format 2022-09-27 18:27:36 +02:00
LICENSE chore: add license 2022-05-16 15:41:56 +02:00
README.md feat: switch to lightweight ini config format 2022-09-27 18:27:36 +02:00
build.zig feat: switch to lightweight ini config format 2022-09-27 18:27:36 +02:00

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