Powermenu is a simple yet configurable power management menu. It is built with gotk3
and gotk3-layershell
— awesome Go bindings for GTK3 and gtk-layer-shell respectively.
Although it is designed mostly for users of standalone Wayland compositors such as Sway, Hyprland, and Niri, powermenu can also be used with all compositors and desktop environments that implement the zwlr_layer_shell_v1
protocol.
Requirements:
- Go
- gtk3 development packages
git clone https://github.com/shelepuginivan/powermenu.git
cd powermenu
sudo make install-local
This will install powermenu in /usr/local/bin
, which is the recommended location for user-installed binaries. If you prefer to install it in /usr/bin
, run the following commands instead:
git clone https://github.com/shelepuginivan/powermenu.git
cd powermenu
sudo make install
powermenu is fully keyboard controlled. The following table describes supported key bindings.
Action | Key bindings |
---|---|
Run active option | Enter |
Quit without doing anything | Esc |
Select next option (right or bottom depending on layout settings) | Right, l, Down, j |
Select previous option (left or top depending on layout settings) | Left, h, Up, k |
Select option by index (depends on the number of enabled options) | 1, 2, 3, 4, 5, 6 |
The configuration file of powermenu is located at $XDG_CONFIG_HOME/powermenu/config.yaml
, which defaults to ~/.config/powermenu/config.yaml
on most systems.
The default configuration file can be found in examples/
.
The default location for icons is $XDG_CONFIG_HOME/powermenu/<action>.svg
, where action is the respective power menu action (e.g. poweroff
, suspend
, etc.)
If icon files don't exist, they will be created and the default icons will be written to the files.
Note
Powermenu uses Carbon Icons by default.
The following image formats are supported, although this list may vary depending on your system.
- ani
- png
- bmp
- gif
- ico
- jpeg
- pnm
- tiff
- xpm
- xbm
- tga
- icns
- qtif
- avif
- heif/avif
- jxl
- svg
Important
Images are displayed with the same dimensions as the size of the image itself. The default size is 144×144 px.
The style file of powermenu is located at $XDG_CONFIG_HOME/powermenu/style.css
, which defaults to ~/.config/powermenu/style.css
on most systems.
While some CSS features are supported, some aren't. See Overview of CSS in GTK for more information.
An example style file can be found in examples/
.
The following diagram describes the widget hierarchy.
GtkWindow#powermenu
└─ GtkBox#container
├─ GtkImage#option
├─ GtkImage#option
├─ GtkImage#option
├─ GtkImage#option.active /* Class .active marks active option. */
├─ GtkImage#option
└─ GtkImage#option
Tip
Run GTK_DEBUG=interactive powermenu
to open the debug window.
This project is licensed under the GNU General Public License v3.0 — see LICENSE.md for details.