Skip to content

Latest commit

Β 

History

History
117 lines (85 loc) Β· 3.37 KB

File metadata and controls

117 lines (85 loc) Β· 3.37 KB

🟦 Box Breathing Tray

A lightweight Windows 11 system tray application that animates the classic box-breathing pattern β€” a dot travels around a square, spending exactly 4 seconds on each side (inhale β†’ hold β†’ exhale β†’ hold), all visible as an animated icon in your taskbar notification area.


Features

Feature Details
🎯 System tray only No main window cluttering your desktop
πŸ”„ Smooth animation ~60 fps dot-on-square in the tray icon
⏱ Customisable timing 1–60 seconds per side (default: 4 s)
🎨 Customisable colours Square outline, dot, and background
πŸ’Ύ Persistent settings Saved to %APPDATA%\BoxBreathingTray\settings.json
πŸš€ Auto-start Installer registers a run-at-login registry key
πŸ“¦ Single-file exe No .NET runtime required β€” fully self-contained

Quick Start (pre-built)

  1. Run BoxBreathingTray_Setup_1.0.0.exe
  2. The app starts immediately and sits in the system tray (bottom-right corner β€” you may need to expand the tray overflow)
  3. Right-click the animated icon β†’ Settings… to customise colours and timing

Building from Source

Prerequisites

Steps

# Clone / download the source, then:
cd BoxBreathingTray

# Build + publish (produces a self-contained single EXE)
.\build.ps1

# The exe will be at: .\publish\BoxBreathingTray.exe
# The installer (if Inno Setup is installed): .\installer\BoxBreathingTray_Setup_1.0.0.exe

Or manually:

dotnet publish BoxBreathingTray.csproj `
    --configuration Release `
    --runtime win-x64 `
    --self-contained true `
    /p:PublishSingleFile=true `
    --output publish

Project Structure

BoxBreathingTray/
β”œβ”€β”€ Program.cs                  # Entry point β€” starts TrayApplicationContext
β”œβ”€β”€ TrayApplicationContext.cs   # ApplicationContext: owns the NotifyIcon
β”œβ”€β”€ AnimationEngine.cs          # Background thread that renders icon frames
β”œβ”€β”€ BreathingSettings.cs        # Settings model + JSON load/save
β”œβ”€β”€ SettingsForm.cs             # Colour + timing settings window
β”œβ”€β”€ BoxBreathingTray.csproj     # SDK-style project (net8.0-windows)
β”œβ”€β”€ app.manifest                # Per-monitor DPI v2 + Win11 compat
β”œβ”€β”€ installer.iss               # Inno Setup script β†’ setup .exe
└── build.ps1                   # One-command build + package script

How the Animation Works

Side 0 (top):    dot travels LEFT β†’ RIGHT  (Inhale)
Side 1 (right):  dot travels TOP  β†’ BOTTOM (Hold)
Side 2 (bottom): dot travels RIGHT β†’ LEFT  (Exhale)
Side 3 (left):   dot travels BOTTOM β†’ TOP  (Hold)

At the default 4 s/side the full cycle is 16 seconds, matching the box-breathing (4-4-4-4) technique.


Settings File

%APPDATA%\BoxBreathingTray\settings.json

{
  "SecondsPerSide": 4,
  "SquareColorArgb": -11206656,
  "DotColorArgb": -1,
  "BackgroundColorArgb": -16777186
}

Delete this file to reset all settings to defaults.


Uninstalling

Control Panel β†’ Programs β†’ Box Breathing Tray β†’ Uninstall
This removes the application files and the auto-start registry entry.