2024-10-22 11:13:41 +00:00
|
|
|
package notifications
|
|
|
|
|
|
|
|
import (
|
2024-10-23 11:16:30 +00:00
|
|
|
"ChronoTomato/internal/shared"
|
2024-10-22 11:13:41 +00:00
|
|
|
"fmt"
|
2024-10-23 11:51:19 +00:00
|
|
|
"strings"
|
2024-10-22 11:13:41 +00:00
|
|
|
)
|
|
|
|
|
2024-10-23 11:16:30 +00:00
|
|
|
func TerminalOutput() {
|
2024-10-22 11:13:41 +00:00
|
|
|
var timerOutput string
|
|
|
|
|
2024-10-23 11:16:30 +00:00
|
|
|
msg := &shared.ServerMessage
|
|
|
|
|
2024-10-22 11:13:41 +00:00
|
|
|
fmt.Print("\033[H\033[2J") // Clears the screen
|
|
|
|
|
|
|
|
fmt.Printf("Work: %d | Break: %d | Longbreak: %d\n",
|
|
|
|
msg.PomodoroSettings.Work/60,
|
|
|
|
msg.PomodoroSettings.ShortBreak/60,
|
|
|
|
msg.PomodoroSettings.LongBreak/60,
|
|
|
|
)
|
|
|
|
fmt.Printf("Session: %d/%d\n",
|
|
|
|
msg.Session,
|
|
|
|
msg.PomodoroSettings.Sessions,
|
|
|
|
)
|
|
|
|
fmt.Printf("\n▶ %s\n",
|
|
|
|
msg.Mode,
|
|
|
|
)
|
|
|
|
|
|
|
|
switch msg.Mode {
|
|
|
|
case "Idle":
|
|
|
|
timerOutput = ""
|
|
|
|
default:
|
|
|
|
minutes := msg.TimeLeft / 60
|
|
|
|
seconds := msg.TimeLeft % 60
|
|
|
|
|
|
|
|
timerOutput = fmt.Sprintf("⏳ %02d:%02d", minutes, seconds)
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Printf(timerOutput)
|
2024-10-23 11:51:19 +00:00
|
|
|
|
|
|
|
//footer
|
|
|
|
fmt.Printf(strings.Repeat("\n", 3))
|
|
|
|
fmt.Printf("s: start • space: pause/resume • r: stop • q: quit")
|
2024-10-22 11:13:41 +00:00
|
|
|
}
|