summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-02 22:39:11 +0200
committerPaul Buetow <paul@buetow.org>2026-01-02 22:40:19 +0200
commit96f92ddd8ea1554766b358333e911f607c3e5d6c (patch)
treeafc26a32d4c42c752165e4975ab74b597ac4c09f /cmd
parent7afe4c2c1afe9d8f4ba8887758523999fde12b7b (diff)
add large ASCII fonts and font cycling to live modev0.3.0main
- Add 4 new ASCII art fonts (mono12, rebel, ansi, ansiShadow) adapted from pomo project - Implement random font selection on startup when no font is specified - Add 'f' hotkey in live mode to cycle through fonts - Update LICENSE with MIT attribution for pomo fonts - Update README with comprehensive font documentation - Bump version to v0.3.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/timr/main.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/cmd/timr/main.go b/cmd/timr/main.go
index 0c4df06..e3bbe03 100644
--- a/cmd/timr/main.go
+++ b/cmd/timr/main.go
@@ -2,10 +2,13 @@ package main
import (
"fmt"
+ "math/rand"
"os"
"strconv"
"strings"
+ "time"
+ "codeberg.org/snonux/timr/internal/ascii"
"codeberg.org/snonux/timr/internal/live"
"codeberg.org/snonux/timr/internal/timer"
tea "github.com/charmbracelet/bubbletea"
@@ -85,7 +88,18 @@ func runCommand(args []string) (string, error) {
description := strings.Join(args[2:], " ")
output, err = timer.TrackTime(description)
case "live":
- p := tea.NewProgram(live.NewModel())
+ // Parse optional font flag
+ var font string
+ if len(args) > 2 && (args[2] == "--font" || args[2] == "-f") {
+ if len(args) > 3 {
+ font = args[3]
+ }
+ } else {
+ // Select a random font if no argument is given
+ rand.Seed(time.Now().UnixNano())
+ font = ascii.AllFonts[rand.Intn(len(ascii.AllFonts))]
+ }
+ p := tea.NewProgram(live.NewModel(font))
if err := p.Start(); err != nil {
return "", err
}
@@ -103,4 +117,5 @@ func runCommand(args []string) (string, error) {
func printUsage() {
fmt.Println("Usage: timr <start|continue|stop|pause|status|reset|live|prompt|track <description>>")
+ fmt.Println(" live [-f|--font <font>] : Show live timer with optional font (doom, mono12, rebel, ansi, ansiShadow)")
}