timer

Session Timer v2.0

A visual analog clock timer with URL schemes, calendar export, and floating window support. Perfect for removing temporal cognition load and maintaining focus on your primary tasks.

๐Ÿ†• Whatโ€™s New in v2.0

Breaking free from iCab dependency: v2.0 introduces native sessiontimer:// URL scheme support, eliminating reliance on third-party browsers while maintaining the same seamless experience.


๐Ÿš€ Quick Start

Web Version (Immediate Use)

Custom URL Scheme Examples

# 30-minute focus session (replaces iCab x-callback-url)
sessiontimer://timer?s=a,14:30,30&mode=down

# Pomodoro sequence 
sessiontimer://segments?data=09:00,25,down|09:25,5,up|09:30,25,down|09:55,15,up

Made with respect to Dieter Rams.

๐Ÿ“ฑ Installation & Setup

macOS: Custom URL Scheme

  1. Build the helper app (requires Xcode command line tools):
    cd macos-helper
    ./build.sh
    
  2. Install:
    cp "build/SessionTimer Helper.app" /Applications/
    open "/Applications/SessionTimer Helper.app"
    
  3. Test:
    open "sessiontimer://timer?s=a,14:30,40&mode=down"
    

iOS: Shortcuts Integration

  1. Import the provided Shortcut: ios-shortcuts/SessionTimer-URLHandler.shortcut
  2. Test with: sessiontimer://timer?s=a,14:30,30&mode=down
  3. Add timer to home screen as PWA for full-screen experience

PWA Installation (iPhone/iPad)

  1. Open timer-v2.html in Safari
  2. Tap Share โ†’ Add to Home Screen
  3. Enjoy offline, full-screen timer experience with gesture controls

๐Ÿ“… Calendar Integration

Using the Interface

  1. Open hamburger menu (โ˜ฐ) in timer-v2.html
  2. Configure timer segments using presets or manual entry
  3. Use Export to Calendar section:
    • Download ICS: Save .ics file for any calendar app
    • Copy ICS: Copy iCalendar data to clipboard
    • Open in Fantastical: Launch directly in Fantastical

Command Line (Automation)

# Generate calendar from JSON segments
./scripts/generateCalendar.sh examples/pomodoro-session.json

# Custom output filename
./scripts/generateCalendar.sh my-segments.json my-calendar.ics

Example segments.json:

[
  {"time": "09:00", "duration": 25, "mode": "down"},
  {"time": "09:25", "duration": 5, "mode": "up"},
  {"time": "09:30", "duration": 25, "mode": "down"}
]

Keyboard Maestro Integration

Use the CLI script in Keyboard Maestro macros:

./generateCalendar.sh "$KMVAR_segments" && open "session-timer-$(date +%Y%m%d-%H%M%S).ics"

๐ŸŽฏ Quick Presets (v2.0)

Built-in presets available in the enhanced settings panel:

๐Ÿš€ Start Now (Manual Start)

Single Timer - Start Immediately

# Count down 30 minutes (manual start)
timer.html?s=m,12:00,30&mode=down

# Count up 45 minutes (manual start)  
timer.html?s=m,12:00,45&mode=up

Note: Use m instead of a for manual start. The time parameter is ignored for manual starts.

โฐ Autostart Timers

Single Timer - Autostart at Specific Time

# Autostart at 2:30 PM, count down for 40 minutes (ends at 3:10 PM)
timer.html?s=a,14:30,40&mode=down

# Autostart at 9:00 AM, count up for 60 minutes (ends at 10:00 AM)
timer.html?s=a,09:00,60&mode=up

Multiple Timers - Sequential Autostart

# Multiple segments with different modes
timer.html?segments=09:00,30,up|10:30,45,down|14:15,60,down

# Full day schedule
timer.html?segments=08:30,90,up|11:00,30,down|13:30,120,down|16:00,45,up

๐Ÿ• Set Timer for Later

Delayed Single Timer

# Timer will autostart at 15:30 (3:30 PM) for 25 minutes
timer.html?s=a,15:30,25&mode=down

# Timer will autostart at 20:15 (8:15 PM) for 90 minutes  
timer.html?s=a,20:15,90&mode=up

Scheduled Multiple Timers

# Evening session - timers start later in the day
timer.html?segments=18:00,45,down|19:30,30,up|21:00,60,down

# Tomorrow morning schedule
timer.html?segments=07:00,30,up|08:15,45,down|10:30,60,down

๐Ÿ“Š Parameter Reference

Single Timer Format:

?S=a,TIME,DURATION&Mode=MODE
Parameter Description Values
s Timer configuration a = autostart, m = manual
TIME Time in HH:MM format 09:30, 14:45, etc.
DURATION Duration in minutes 30, 45, 120, etc.
mode Count direction up or down

Multiple Timer Format:

?segments=TIME,DURATION,MODE|TIME,DURATION,MODE|...

| Component | Description | Example | |โ€”โ€”โ€”โ€“|โ€”โ€”โ€”โ€”-|โ€”โ€”โ€“| | TIME | HH:MM format | 09:00, 13:30 | | DURATION | Minutes | 30, 45, 90 | | MODE | Count direction | up, down | | | | Separator between segments | 09:00,30,up|10:30,45,down | รท

๐ŸŽฏ Practical Examples

Workout Session Warm-up + Main + Cool-down

timer.html?segments=06:00,15,up|06:15,45,down|07:00,10,up

Work Pomodoro 25min work + 5min break + 25min work + 15min break

timer.html?segments=09:00,25,down|09:25,5,up|09:30,25,down|09:55,15,up

Cooking Schedule Prep + Cook + Rest

timer.html?segments=17:30,20,up|17:50,35,down|18:25,10,up

Study Sessions Morning study blocks

timer.html?segments=08:00,50,down|09:00,10,up|09:10,50,down|10:10,20,up

๐Ÿ” Time Interpretation Guide

Count Down Mode (mode=down or default)

Count Up Mode (mode=up)

โšก Quick Reference

Start Now

timer.html?s=m,00:00,30    # 30 minutes, manual start

Start at Specific Time

timer.html?s=a,14:30,45    # Start at 2:30 PM for 45 minutes

Multiple Sessions

timer.html?segments=10:00,30,up|11:00,45,down|15:30,60,down

Mid-Session Join

If you load a URL after the start time but before the end time, the timer will:

๐Ÿ› ๏ธ URL Generation

The hamburger menu automatically generates these URLs when you:

  1. Add segments using the UI
  2. Configure times and durations
  3. Select count up/down modes
  4. Copy the generated URL from the text area

This may make it easier than manually constructing URLs - for some.

๐Ÿ” Hamburger Menu Features (v2.0 Enhanced)

Settings Panel

User Interface

Control Methods

๐ŸชŸ Floating Window Mode (v2.0)

Chromeless Desktop Display

# Open in floating popup window
timer.html?s=a,14:30,40&mode=down&view=popup
sessiontimer://timer?s=a,14:30,40&mode=down&view=popup

Features

Usage

  1. Configure your timer in the main window
  2. Click โ€œOpen Floating Windowโ€ in the URL section
  3. Timer opens in chromeless popup
  4. Close main window if desired - timer continues independently

โŒจ๏ธ Enhanced Controls (v2.0)

Quick Preset Access

Dual URL Generation

๐ŸŽจ Visual Features

Timer Display

Color Customization (v2.0)

Personalize timer colors to match your workflow preferences:

Examples:

Design rationale: Minutes are more intuitive than percentages and work consistently across different timer durations. A 30-minute session and 2-hour session both benefit from the same โ€œ5 minutes remainingโ€ warning, whereas percentage-based thresholds would feel inconsistent.

Completion Notifications (v2.0)

Customizable alerts when timer segments complete:

Accessibility Benefits: Multiple notification modalities ensure completion awareness regardless of user attention focus, environmental noise, or device settings.

Second Hand Behavior (v2.0)

Customizable second hand movement with luxury watch aesthetics:

Technical Implementation: Uses dual second hands with opacity-based transitions and proper state management to achieve smooth, jitter-free animation. The feature automatically resets on timer state changes to prevent any visual artifacts.

Design Philosophy: This experimental feature creates a subtle yet noticeable visual cue at the top of each minute, helping with time awareness during idle periods. The second hand pauses at 12 oโ€™clock, then smoothly continues, creating an elegant mechanical feel reminiscent of luxury timepieces.

Status Messages

๐Ÿ“ฑ Usage Examples

Simple 30-minute Focus Session

timer.html?s=a,10:30,30&mode=down

Pomodoro Technique

timer.html?segments=09:00,25,down|09:25,5,up|09:30,25,down|09:55,15,up

Workout Routine

timer.html?segments=07:00,10,up|07:10,20,down|07:30,5,up|07:35,20,down|07:55,5,up

Meeting Schedule

timer.html?segments=14:00,45,down|14:50,10,up|15:00,30,down

๐Ÿ”ง Technical Notes

๐Ÿ“‹ File Structure

v2.0 Enhanced Architecture

Session-Timer/
โ”œโ”€โ”€ timer.html              # Original single-file version
โ”œโ”€โ”€ timer-v2.html           # New enhanced version with all v2.0 features
โ”œโ”€โ”€ index.html              # Legacy version with external JSON
โ”œโ”€โ”€ settings.html           # Legacy settings generator
โ”œโ”€โ”€ settings.json           # Fallback JSON configuration
โ”œโ”€โ”€ manifest.json           # PWA manifest for home screen installation
โ”œโ”€โ”€ sw.js                   # Service worker for offline functionality
โ”œโ”€โ”€ src/                    # Modular ES6 components
โ”‚   โ”œโ”€โ”€ eventBus.js         # Event system for module communication
โ”‚   โ”œโ”€โ”€ coreTimer.js        # Timer logic, animation, and drawing
โ”‚   โ”œโ”€โ”€ urlParser.js        # URL handling and generation
โ”‚   โ””โ”€โ”€ calendarExport.js   # ICS generation and calendar integration
โ”œโ”€โ”€ macos-helper/           # Custom URL scheme support
โ”‚   โ”œโ”€โ”€ build.sh            # Build script for helper app
โ”‚   โ”œโ”€โ”€ SessionTimerHelper/ # Swift source code
โ”‚   โ””โ”€โ”€ build/              # Compiled .app bundle (after build)
โ”œโ”€โ”€ ios-shortcuts/          # iOS integration
โ”‚   โ””โ”€โ”€ SessionTimer-URLHandler.shortcut
โ”œโ”€โ”€ scripts/                # Command-line automation tools
โ”‚   โ””โ”€โ”€ generateCalendar.sh # CLI calendar generator with jq/icalBuddy
โ””โ”€โ”€ examples/               # Sample configurations for testing
    โ”œโ”€โ”€ pomodoro-session.json
    โ””โ”€โ”€ focus-session.json

Deployment Options

Single File (Current): timer.html remains fully self-contained Enhanced v2.0: timer-v2.html + supporting files for full feature set PWA: All files for offline home screen installation Development: Modular src/ components with build process

Accessibility and Cognitive Load Reduction

This application is particularly suitable for individuals who experience difficulties with temporal cognition and calculation. Research indicates that people with dyscalculia often have impaired number sense and difficulties in estimating or manipulating temporal intervals (Butterworth, 2010). Similarly, those with executive function deficits, such as individuals with ADHD, frequently demonstrate โ€œtime-blindness,โ€ defined as impaired awareness of elapsed and future time, which can compromise planning and sustained task engagement (Barkley, 1997; Brown, 2005). For such populations, interpreting analogue clocks or performing time arithmetic can present unnecessary cognitive load, distracting from the primary task. By externalizing time tracking, automating calculations, and presenting progress in an intuitive visual form, this application minimizes distraction and supports task persistence.

References