hdmenu-0.3.0: A small wrapper around dmenu
Safe HaskellSafe-Inferred
LanguageGHC2021

Core.Select

Synopsis

Interacting with dmenu

selectWith Source #

Arguments

:: [String]

List of options to give to dmenu.

-> [ByteString]

List of executables from which the user should select.

-> String

The dmenu executable.

-> IO (Either ProcessError ByteString)

The selection made by the user, or a ProcessError, if the user canceled.

Run dmenu with the given command line options and a list of entries from which the user should choose.

Originally select.

Interacting with the history file

tryRead :: FilePath -> IO Items Source #

Try to read a file that contains a map. Return an empty map if the file doesn't exist.

runUpdate Source #

Arguments

:: ByteString

What the user picked.

-> Config

User config containing things that interest us.

-> Items

Map prior to selection.

-> IO () 

Do the appropriate things with the user selection and update the history file.

Interacting with the system

getExecutables :: IO [ByteString] Source #

Get all executables from all dirs in $PATH.

evalDirs :: [ByteString] -> IO [ByteString] Source #

Apply evalDir to some list of file paths.

Pretty printing

showItems :: Items -> ByteString Source #

Pretty print our items.

Utility

makeNewEntries :: [ByteString] -> Items Source #

Turn a list into Items and set all starting values to 0.

sortByValues :: Items -> [ByteString] Source #

Sort Items by its values and return the list of keys. This will make often used commands bubble up to the top.