Requires https://github.com/caarlos0/timer to be installed
# --- The Main Function ---
function Start-PomoTimer {
param (
[string]$TimerType
)
$pomoOptions = @{
"work" = "50m"
"break" = "10m"
"short" = "5m"
}
# --- REMEMBER TO UPDATE YOUR PATH HERE ---
$timerPath = "D:\timer\timer.exe"
if ($pomoOptions.ContainsKey($TimerType)) {
$duration = $pomoOptions[$TimerType]
Write-Host "Starting '$TimerType' timer for $duration..."
& $timerPath $duration -n $TimerType
Write-Host "'$TimerType' session done!"
} else {
Write-Host "Invalid timer type: '$TimerType'. Available types: $($pomoOptions.Keys -join ', ')"
}
}
function Start-PomoWork {
Start-PomoTimer -TimerType "work"
}
function Start-PomoBreak {
Start-PomoTimer -TimerType "break"
}
# --- Updated Aliases pointing to the new functions ---
Set-Alias -Name wo -Value Start-PomoWork
Set-Alias -Name br -Value Start-PomoBreak
wo
br