Skip to content

Instantly share code, notes, and snippets.

@nameerakhter
Last active August 11, 2025 08:00
Show Gist options
  • Save nameerakhter/1748f5dfcab23852b5b826c3382846e4 to your computer and use it in GitHub Desktop.
Save nameerakhter/1748f5dfcab23852b5b826c3382846e4 to your computer and use it in GitHub Desktop.
Pomodoro Timer inspired by bashbunny .zshrc script but for windows

πŸ•’ Pomodoro Timer PowerShell Script

πŸ“Œ Main Function

# --- 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

Start a work session

wo

Start a break session

br

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment