dmenu

package
v0.0.0-...-8bac4ff Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item[T any] struct {
	// DisplayText is what will be shown in the dmenu
	DisplayText string
	// Value is the actual data associated with this item
	Value T
}

Item is a generic struct that can hold any type of value

func SelectItem

func SelectItem[T any](items []Item[T], prompt string) (*Item[T], error)

SelectItem displays a dmenu prompt with the display text from each item and returns the selected item with its associated value of type T

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value string
}

KeyValuePair represents a key-value pair where both key and value are strings This is kept for backwards compatibility

func Select

func Select(pairs []KeyValuePair, prompt string) (*KeyValuePair, error)

Select displays a dmenu prompt with the given keys from the key-value pairs and returns the selected key-value pair This is kept for backwards compatibility

Jump to

Keyboard shortcuts

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