A simple, customizable timer application with global hotkeys and system notifications.
- Customizable timer length
- Global hotkeys that work even when app is not focused
- Option to disable hotkeys when timer is running
- Pop-up window when timer ends (optional)
- Notification sound when timer ends (optional)
- Settings persistence
- System tray integration
- Single instance (prevents multiple copies)
# Create a new directory
mkdir simple-timer
cd simple-timer
# Initialize npm and install dependencies
npm init -y
npm install electron electron-store --save
npm install electron-builder --save-devCopy all the provided files into your project directory:
package.jsonmain.jspreload.jsindex.htmlstyle.cssrenderer.js
mkdir assetsYou'll need to add these icon files to the assets folder:
icon.png(256x256px) - Main app iconicon.ico(Windows icon)icon.icns(macOS icon)tray-icon.png(16x16px) - System tray icon
For quick testing, you can use any small PNG images temporarily.
Replace your package.json with the provided one, or copy the important parts:
- Scripts section
- Dependencies
- Build configuration
# Development mode
npm start
# Or with dev flag for debugging
npm run dev# Build for current platform
npm run build
# Build and create installer
npm run dist- Start/Stop/Reset: Use the buttons in the interface
- Settings: Modify timer length, hotkey behavior, and end-of-timer actions
- Hotkeys: Click "Change" buttons to set custom global hotkeys
- Ctrl+Shift+S: Start timer
- Ctrl+Shift+P: Stop timer
- Ctrl+Shift+R: Reset timer
- Right-click the tray icon for quick actions
- Double-click to show/hide the main window
- Launch: App opens with default 10-minute timer
- Customize: Set your preferred timer length and behaviors
- Set Hotkeys: Change global hotkeys if desired
- Start Timer: Use button or hotkey to start
- Timer Runs: Use hotkeys to control (unless disabled)
- Timer Ends: Window pops up (optional) and sound plays (optional)
- Repeat: Reset and start again, or modify settings
All settings are automatically saved and restored:
- Timer length (1-999 minutes)
- Global hotkeys (fully customizable)
- Hotkey behavior when running
- End-of-timer popup behavior
- Notification sound preference
- Window position and size
- Make sure no other app is using the same key combination
- Try different key combinations
- Check if the app has necessary permissions
- Ensure all dependencies are installed:
npm install - Check that all files are in the correct locations
- Try running with:
npm run devfor debugging output
- Make sure you have the required icon files
- Check that
electron-builderis installed - Try deleting
node_modulesand runningnpm installagain
- The app uses Electron with context isolation for security
- Settings are stored using
electron-store - Global shortcuts use Electron's built-in
globalShortcutAPI - Notifications use both Electron notifications and Web Audio API for sounds
You can easily modify:
- Colors/Theme: Edit
style.css - Default Settings: Change defaults in
main.jsstore initialization - Additional Features: Add new IPC handlers and UI elements
- Sounds: Modify the
playNotificationSound()function inrenderer.js