FocusTray

A minimalist Windows system tray application designed to help you maintain deep focus during work sessions by providing visual feedback and non-intrusive notifications.

Overview
FocusTray is a lightweight productivity tool that lives in your Windows system tray, helping you stay focused on your work with configurable focus sessions. The application provides clear visual feedback through dynamic tray icons and elegant toast notifications positioned above your taskbar.
Key Features
-
š Smart System Tray Integration: Professional bell icons that change based on session state
- Standard bell icon when idle
- Bell with slash icon during active focus sessions (indicating "do not disturb")
-
ā±ļø Customizable Focus Sessions: Define your own work intervals
- Configure task descriptions for each session
- šÆ JIRA Integration: Link sessions to JIRA issues with automatic worklog tracking
- Set custom durations (from 1 minute to 24 hours)
- Default 25-minute Pomodoro-style sessions
-
š JIRA Worklog Automation: Seamless time tracking for Atlassian Cloud
- Select JIRA issues directly from your assigned tasks
- Automatic worklog entries when sessions complete
- Configurable JQL filters for issue selection
- Optional - works standalone without JIRA
-
š¢ Non-Intrusive Notifications: Native Windows toast notifications
- True system notifications using Windows Action Center
- Auto-dismiss after configured time
- Clean, native Windows 10/11 appearance
-
šÆ Visual Session Tracking: Real-time session monitoring
- Live countdown in system tray tooltip
- Analog clock visualization in session status dialog
- Session progress indicator
-
š Session Management: Full control over your focus time
- Start, pause, resume, and stop sessions
- Manual session termination when needed
- Session state persistence
Installation
Via WinGet
winget install Kubis1982.FocusTray
Via GitHub Releases
Download the latest release from GitHub Releases and run the executable.
Prerequisites
- Windows 10 (build 19041) or later
- No additional dependencies required (.NET 10.0 Runtime is embedded)
Build from Source
# Clone the repository
git clone https://github.com/kubis1982/FocusTray.git
cd FocusTray
# Build the solution
dotnet build FocusTray.slnx
# Run the application
dotnet run --project src/FocusTray/FocusTray.csproj
# Create a release build
dotnet publish src/FocusTray/FocusTray.csproj -c Release
Usage
JIRA Integration Setup (Optional)
FocusTray can automatically track time in JIRA Atlassian Cloud:
-
Generate a JIRA API Token:
-
Configure JIRA in FocusTray:
- Right-click the tray icon
- Select "JIRA Settings"
- Enter your JIRA details:
- Company Name: Your Atlassian company identifier (e.g., "yourcompany" for yourcompany.atlassian.net)
- Email: Your Atlassian account email
- API Token: Paste the token you generated
- (Optional) Customize JQL filter for issue selection
- Click "Test Connection" to verify
- Click "Save"
-
Default JQL Filter:
assignee = currentUser() AND statusCategory != Done ORDER BY updated DESC
This shows your assigned, incomplete issues sorted by most recently updated.
ā ļø Security Note: JIRA credentials are stored locally in:
%LocalApplicationData%\FocusTray\settings.json
Keep this file secure and never commit it to source control.
Starting a Focus Session
- Right-click the FocusTray icon in your system tray
- Select "Start Focus Session"
- Choose your work tracking method:
- Manual Description: Enter a task description (e.g., "Code review")
- JIRA Issue (if configured): Check "Use JIRA issue", select an issue from the dropdown
- Set the duration in minutes (default: 25)
- Click "Start"
The tray icon will change to a "bell with slash" icon, indicating an active focus session.
Completing a Session with JIRA
When a session linked to a JIRA issue completes:
- A prompt will ask: "Log 25 minutes to JIRA-123?"
- Click "Yes" to create a worklog entry in JIRA
- Click "No" to skip worklog creation
The worklog entry includes:
- Time spent (from session duration)
- Session description as a comment
- Automatically timestamped to when the session started
Monitoring Your Session
- Hover over the tray icon to see remaining time
- Right-click and select "View Current Session" to see detailed progress
- The tooltip updates every second with remaining time
Ending a Session
Sessions automatically complete when the timer expires, showing a completion notification.
To manually end a session:
- Right-click the tray icon
- Select "End Session"
- Confirm the action
Exiting the Application
- Right-click the tray icon
- Select "Exit"
Technical Architecture
FocusTray follows Clean Architecture principles with clear separation of concerns:
FocusTray/
āāā src/
ā āāā FocusTray/ # WPF UI Layer (net10.0-windows)
ā ā āāā MainWindow.xaml # System tray integration
ā ā āāā SessionConfigDialog.xaml # Session configuration with JIRA
ā ā āāā SessionStatusDialog.xaml # Session monitoring
ā ā āāā ViewModels/ # MVVM ViewModels
ā ā āāā Services/ # Settings persistence
ā āāā FocusTray.Core/ # Domain Layer (net10.0)
ā ā āāā Models/ # Domain entities (FocusSession, JiraIssue, etc.)
ā ā āāā Services/ # Business logic interfaces
ā āāā FocusTray.Infrastructure/ # Infrastructure Layer (net10.0)
ā āāā Jira/ # JIRA REST API integration
āāā tests/
āāā FocusTray.Tests/ # Unit tests (with mocks)
āāā FocusTray.IntegrationTests/ # Integration tests (optional, needs credentials)
Key Components
Core Layer (FocusTray.Core)
ITimerService: Interface for timer management
TimerService: Implementation of focus session timer logic
IJiraService: Interface for JIRA integration
FocusSession: Domain model representing a work session
JiraIssue: Domain model for JIRA issues
JiraWorklog: Domain model for worklog entries
TimerState: Enum for session states (Idle, Running, Paused, Completed)
UI Layer (FocusTray)
- WPF application with system tray integration
- MVVM pattern with CommunityToolkit.Mvvm
- SessionConfigDialogViewModel for JIRA issue selection
- SettingsService for configuration persistence
- Uses H.NotifyIcon.Wpf for taskbar icon management
- CommunityToolkit.WinUI.Notifications for native Windows toast notifications
- Custom analog clock visualization
Infrastructure Layer (FocusTray.Infrastructure)
JiraService: REST API integration with Atlassian Cloud
- HTTP-based communication using System.Net.Http.Json
- Basic Authentication with email + API token
- Configuration model with validation
Technology Stack
- .NET 10.0 - Latest .NET platform with Windows 10.0.19041.0 target
- WPF - Windows Presentation Foundation for desktop UI
- CommunityToolkit.Mvvm 8.4.2 - MVVM framework with source generators
- H.NotifyIcon.Wpf 2.4.1 - System tray icon management
- CommunityToolkit.WinUI.Notifications 7.1.2 - Native Windows toast notifications
- WPF-UI 4.2.1 - Modern UI controls for WPF
- Microsoft.Extensions.* - Dependency injection, logging, HTTP client, and options
- System.Net.Http.Json - JSON serialization for REST APIs
- Serilog - Structured logging with file sink
- xUnit v3 - Unit testing framework
- AwesomeAssertions - Fluent assertion library
- Moq 4.20.72 - Mocking framework for tests
Development
Building MSIX Package
FocusTray is distributed as an MSIX (Microsoft Application Package) for Microsoft Store.
For Developers: Build and test locally
cd FocusTray
.\build\scripts\Create-SelfSignedCert.ps1 # Generate test certificate
.\build\scripts\Build-MSIX.ps1 # Build MSIX package
Running Tests
# Run all tests
dotnet test FocusTray.slnx
# Run unit tests only (no credentials needed)
dotnet test tests/FocusTray.Tests/FocusTray.Tests.csproj
# Run integration tests (requires JIRA credentials)
# Set environment variables first:
# $env:JIRA_COMPANY = "yourcompany" # Company name (e.g., for yourcompany.atlassian.net)
# $env:JIRA_EMAIL = "your.email@company.com"
# $env:JIRA_API_TOKEN = "your-api-token"
dotnet test tests/FocusTray.IntegrationTests/FocusTray.IntegrationTests.csproj
# Run tests with coverage
dotnet test FocusTray.slnx --collect:"XPlat Code Coverage"
Note: Integration tests are automatically skipped if JIRA environment variables are not set.
See tests/FocusTray.IntegrationTests/README.md for detailed setup instructions.
Project Structure
The solution uses .slnx format for better performance and modern tooling support.
Dependencies
All NuGet dependencies are managed centrally through the solution file. Key packages:
- Microsoft.Extensions.DependencyInjection 10.0.7 - Dependency injection
- Microsoft.Extensions.Http 10.0.7 - HTTP client factory
- Microsoft.Extensions.Logging 10.0.7 - Logging abstraction
- Microsoft.Extensions.Options 10.0.7 - Configuration options pattern
- Serilog 4.3.1 with Serilog.Sinks.File 7.0.0 - Structured file-based logging
- Serilog.Extensions.Logging 10.0.0 - Integration with Microsoft.Extensions.Logging
- H.NotifyIcon.Wpf 2.4.1 - System tray functionality
- WPF-UI 4.2.1 - Modern WPF controls
- CommunityToolkit.WinUI.Notifications 7.1.2 - Native Windows toast notifications
- CommunityToolkit.Mvvm 8.4.2 - MVVM helpers and source generators
Configuration
FocusTray stores configuration in:
%LocalApplicationData%\FocusTray\settings.json
Session Settings
- Default Session Duration: 25 minutes (Pomodoro technique)
- Maximum Duration: 24 hours (1440 minutes)
- Notification Type: Native Windows toast notifications
- Update Interval: 1 second
JIRA Settings (Optional)
When JIRA integration is enabled, the settings file contains:
{
"JiraConfiguration": {
"Company": "yourcompany",
"JqlFilter": "assignee = currentUser() AND statusCategory != Done"
}
}
Note: Authentication credentials (email and API token) are stored securely in Windows Credential Manager, not in the settings file.
ā ļø Security Note:
- JIRA company name and JQL filter are stored in:
%LocalApplicationData%\FocusTray\settings.json
- Authentication credentials (email and API token) are stored securely in Windows Credential Manager
- Never commit
settings.json to source control
- Credentials are encrypted and managed by Windows
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Icon design inspired by productivity and focus themes
- Built with modern .NET 10 and WPF technologies
Support
For issues, questions, or suggestions:
- Open an issue on GitHub Issues
- Check existing documentation and FAQs
Made with ā¤ļø for focused productivity