From 77eeb087e3a3ba14af3bf2e6e965662d487a51a5 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Thu, 24 Oct 2024 19:16:57 +0200 Subject: [PATCH] feat: add state icons for start/paused/stoppped --- internal/notifications/terminal.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/notifications/terminal.go b/internal/notifications/terminal.go index 03fb15a..acf0bd5 100644 --- a/internal/notifications/terminal.go +++ b/internal/notifications/terminal.go @@ -8,35 +8,42 @@ import ( ) func TerminalOutput() { + var modePrefix string var timerOutput string pomodoro := &shared.ServerMessage fmt.Print("\033[H\033[2J") // Clears the screen + // header color.Blue("Work: %d ◊ Break: %d ◊ Longbreak: %d\n\n", pomodoro.PomodoroSettings.Work/60, pomodoro.PomodoroSettings.ShortBreak/60, pomodoro.PomodoroSettings.LongBreak/60, ) - fmt.Printf("Session: %d/%d\n", - pomodoro.Session, - pomodoro.PomodoroSettings.Sessions, - ) - fmt.Printf("▶ %s\n", - pomodoro.Mode, - ) + //body switch pomodoro.Mode { case "Idle": + modePrefix = " " timerOutput = "" default: + modePrefix = " " + if pomodoro.Paused { + modePrefix = " " + } else { + } minutes := pomodoro.TimeLeft / 60 seconds := pomodoro.TimeLeft % 60 timerOutput = fmt.Sprintf("⏳ %02d:%02d", minutes, seconds) } + fmt.Printf("Session: %d/%d\n", + pomodoro.Session, + pomodoro.PomodoroSettings.Sessions, + ) + fmt.Printf("%s %s\n", modePrefix, pomodoro.Mode) fmt.Printf(timerOutput) //footer