menu

package module
v0.0.0-...-c299779 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

README

UMH

Well, this got a little bit out of control.

A cross-platform system tray menu, that turned into a popup launcher and more.

There are currently three programs available: a system tray menu, a floating icon, and a popup launcher.

Features

UMH has picked up a lot of different abilities. As well as displaying a user menu, it can scan your network for other machines and services, publish services of its own, launch applications, open files to edit, open urls and run shell commands.

Tray menu

The tray menu sits in the system tray(Windows) or the menu bar (Mac). It displays the user-defined menu, as well as several auto-generated menus, like the Applications menu, and the network services menu.

Floating icon

Creates an icon on the screen that floats in front of all your other windows. You can choose what happens when you click it.

Popup launcher

The popup launcher works similar to the built-in search on macosx. Press a button (F12), and the launcher will appear. Type your search, then use the up and down arrows to select your choice.

The options that appear in the popup launcher are not all automatically generated, they come from a file (~/.menu.recall.text). You can always find this file by searching for "Edit Recall Menu", then selecting that option from the list.

Use

For more information on use, please consult the manual

Documentation

Overview

nodes.go

Index

Constants

This section is empty.

Variables

View Source
var RecallCache [][]string

Functions

func Activate

func Activate(value string) bool

func ActiveBufferAppend

func ActiveBufferAppend(gc *GlobalConfig, txt string)

func AddActiveBuffer

func AddActiveBuffer(gc *GlobalConfig, text string, fileName string)

Create a new buffer, make it active and set its contents. file name is required for a unique key to index it If a buffer called fileName already exists, its data will be replaced with the new data

func AppendNode

func AppendNode(menu, item *Node)

func Apps

func Apps() [][]string

Get a list of all (major gui) apps installed on the system

func BuffAppend

func BuffAppend(gc *GlobalConfig, buffId int, txt string)

func DeleteLeft

func DeleteLeft(t string, p int) string

func Dispatch

func Dispatch(command string, gc *GlobalConfig)

This function carries out commands. It is the interface between your scripting, and the actual engine operation

func DoPageDown

func DoPageDown(gc *GlobalConfig, buf *Buffer)

func DumpBuffer

func DumpBuffer(gc *GlobalConfig, b *Buffer)

func ExciseSelection

func ExciseSelection(buf *Buffer)

func FindMacApps

func FindMacApps(appDir string, recurseLimit int) []string

Recursive find folders ending in .app and return a list of them, with paths

func GetSummaries

func GetSummaries(maxItems int, username, password []byte) [][]string

username := goof.CatFile("username") password := goof.CatFile("password")

func IncreaseFont

func IncreaseFont(buf *Buffer)

func Is_space

func Is_space(l string) bool

func LoadFileIfNotLoaded

func LoadFileIfNotLoaded(gc *GlobalConfig, fileName string)

func Log2Buff

func Log2Buff(gc *GlobalConfig, s string)

func NextBuffer

func NextBuffer(gc *GlobalConfig)

func NodesToStringArray

func NodesToStringArray(ns []*Node) []string

func PageDown

func PageDown(buf *Buffer)

func PageUp

func PageUp(buf *Buffer, w, h int)

func PasteFromClipBoard

func PasteFromClipBoard(gc *GlobalConfig, buf *Buffer)

func Predict

func Predict(newString []byte) ([]string, []string)

func PreviousBuffer

func PreviousBuffer(gc *GlobalConfig)

func PreviousCharacter

func PreviousCharacter(buf *Buffer)

func ProcessPort

func ProcessPort(gc *GlobalConfig, r io.Reader)

func Recall

func Recall() [][]string

Read the recall file, used to make the launcher menu

func RecallFilePath

func RecallFilePath() string

func ReduceFont

func ReduceFont(buf *Buffer)

func SOL

func SOL(txt string, c int) int

func SOT

func SOT(txt string, c int) int

func SSHAgent

func SSHAgent() ssh.AuthMethod

func SaveFile

func SaveFile(gc *GlobalConfig, fname string, txt string)

func ScanToEndOfLine

func ScanToEndOfLine(txt string, c int) int

func ScanToNextLine

func ScanToNextLine(txt string, c int) int

func ScanToNextPara

func ScanToNextPara(txt string, c int) int

func ScanToPrevLine

func ScanToPrevLine(txt string, c int) int

func ScanToPrevPara

func ScanToPrevPara(txt string, c int) int

func ScrollToCursor

func ScrollToCursor(buf *Buffer)

func SearchBackPage

func SearchBackPage(txtBuf string, orig_f *glim.FormatParams, screenWidth, screenHeight int) int

Does a page up, by searching backwards util the old top line is off the bottom of the screen

func SetFont

func SetFont(buf *Buffer, size float64)

func ToggleVerticalMode

func ToggleVerticalMode(gc *GlobalConfig)

Types

type Buffer

type Buffer struct {
	Data      *BufferData
	InputMode bool
	Formatter *glim.FormatParams
}

func FindByFileName

func FindByFileName(gc *GlobalConfig, fileName string) (int, *Buffer)

func NewBuffer

func NewBuffer() *Buffer

type BufferData

type BufferData struct {
	Text     string //FIXME rename Buffer to View, have proper text buffer manager
	FileName string
}

type GlobalConfig

type GlobalConfig struct {
	ActiveBuffer   *Buffer
	ActiveBufferId int
	BufferList     []*Buffer
	LogBuffer      *Buffer
	StatusBuffer   *Buffer
	CommandBuffer  *Buffer
}

func NewEditor

func NewEditor() *GlobalConfig

type Node

type Node struct {
	Name     string
	SubNodes []*Node
	Command  string
	Data     string
	Function func() `json:"-"`
}

func AddTextNodesFromCommands

func AddTextNodesFromCommands(startNode *Node, lines []string) *Node

Add nodes from a string list, without processing

func AddTextNodesFromStrStr

func AddTextNodesFromStrStr(startNode *Node, lines [][]string) *Node

Add nodes from a string list, where the first string is the display name, the second is the command

func AddTextNodesFromStrStrStr

func AddTextNodesFromStrStrStr(startNode *Node, lines [][]string) *Node

func AddTextNodesFromString

func AddTextNodesFromString(startNode *Node, src string) *Node

func AddTextNodesFromStringList

func AddTextNodesFromStringList(startNode *Node, lines []string) *Node

Split each string using a shell parser, build a node tree from the split words

func AppsMenu

func AppsMenu() *Node

func ControlMenu

func ControlMenu() *Node

Add system control functions. Probably better moved to a user menu

func Dir2Menu

func Dir2Menu(parent *Node) *Node

Make a menu that opens the data files in the current directory, using the platform file open command

func FindNode

func FindNode(n *Node, name string) *Node

func HistoryMenu

func HistoryMenu() *Node

Add a menu made from command history

func MakeNodeLong

func MakeNodeLong(name string, subNodes []*Node, command, data string) *Node

func MakeNodeShort

func MakeNodeShort(name string, subNodes []*Node) *Node

func MakeStartNode

func MakeStartNode() *Node

func TieredAppsMenu

func TieredAppsMenu() *Node

Make an applications menu node tree by reading the applications directory on your system

func (*Node) String

func (n *Node) String() string

func (*Node) ToString

func (n *Node) ToString() string

Directories

Path Synopsis
gui.go
gui.go
gui.go
gui.go
main
main
gui.go
gui.go
gui.go
gui.go
old
nodes.go
nodes.go
gui.go
gui.go
gui.go
gui.go
p2p
cli
gui.go
gui.go
gui.go
gui.go
ui.go
ui.go

Jump to

Keyboard shortcuts

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