powermenu

package
v0.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package powermenu is the native power menu (shell/power_menu): a full-screen dimmed overlay with a centered pane of frosted glass holding lock, log out, suspend, reboot and shut-down buttons, each running its [modules.power] command. The power module's `:menu` binding opens it; the left and right arrows walk the buttons and Escape dismisses it. It enters and leaves through the power surface's transition, and a button's command runs once the menu is gone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Config is the live config; commands are read on click.
	Config func() *config.Config
	// Open maps the overlay.
	Open func(cfg app.LayerConfig) (Window, error)
	// Run runs a command without waiting for it (spawn.Quiet).
	Run func(cmd string)
	// Font shapes the labels; Sheet (the power-menu-* rules) styles
	// the overlay.
	Font  render.Font
	Sheet *widget.Stylesheet
}

Deps are the menu's collaborators.

type Menu struct {
	// contains filtered or unexported fields
}

Menu is the power menu. Its methods run on the UI loop.

func New

func New(d Deps) *Menu

New builds the menu; nothing maps until Show.

func (m *Menu) Cancel()

Cancel plays the exit and closes the menu.

func (m *Menu) Open() bool

Open reports whether the menu is up (its exit not begun).

func (m *Menu) Run(cmd string)

Run plays the exit, closes the menu, then runs cmd (an empty one runs nothing).

func (m *Menu) Show()

Show opens the menu with the current config's buttons, or does nothing while it is already up.

type Window

type Window interface {
	Close()
	SetFocus(widget.Widget) error
}

Window is the overlay surface the menu maps (app.LayerWindow).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL