feat: initial gosleep-timer implementation
Go TUI sleep timer with modular architecture. - Config: YAML-based, profile inheritance, auto WM detection - Engine: timer, executor, stage pipeline (pre→timer→post) - Modules: workspace (niri/hyprland/kde), media, lock, kill, notify, sound, brightness, mute, custom, script - TUI: bubbletea app with profiles, module toggles, progress bar - CLI: run, list-profiles, export, import, history, stats - History: JSONL log with statistics - QR: config export as ASCII QR
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package tui
|
||||
|
||||
type KeyAction int
|
||||
|
||||
const (
|
||||
KeyQuit KeyAction = iota
|
||||
KeyStart
|
||||
KeyStop
|
||||
KeyToggleModule
|
||||
KeyNextProfile
|
||||
KeyPrevProfile
|
||||
KeyFocusNext
|
||||
KeyFocusPrev
|
||||
KeyHistory
|
||||
KeyStats
|
||||
KeyHelp
|
||||
)
|
||||
|
||||
type KeyBinding struct {
|
||||
Key string
|
||||
Action KeyAction
|
||||
Label string
|
||||
}
|
||||
|
||||
var DefaultKeyBindings = []KeyBinding{
|
||||
{Key: "s", Action: KeyStart, Label: "start"},
|
||||
{Key: "S", Action: KeyStop, Label: "stop"},
|
||||
{Key: "tab", Action: KeyFocusNext, Label: "next"},
|
||||
{Key: "shift+tab", Action: KeyFocusPrev, Label: "prev"},
|
||||
{Key: "h", Action: KeyHistory, Label: "history"},
|
||||
{Key: "?", Action: KeyHelp, Label: "help"},
|
||||
{Key: "q", Action: KeyQuit, Label: "quit"},
|
||||
{Key: "esc", Action: KeyQuit, Label: "quit"},
|
||||
}
|
||||
|
||||
func HelpView() string {
|
||||
s := "\n Keys:\n"
|
||||
for _, kb := range DefaultKeyBindings {
|
||||
s += " " + kb.Key + " — " + kb.Label + "\n"
|
||||
}
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user