Skip to content

Lightweight Windows system tray application that prevents your computer from entering sleep mode. Single binary, no dependencies.

License

Notifications You must be signed in to change notification settings

dklima/sleep_nomore

Repository files navigation

Sleep No More

Go Platform License Release

Tests Release Go Report Card codecov

A Windows application that keeps your computer awake by preventing it from entering sleep mode.

Features

  • ✅ System tray icon
  • ✅ Red icon when disabled
  • ✅ Green icon when enabled
  • ✅ Single click to toggle awake mode
  • ✅ Right-click context menu
  • ✅ Single binary with no external dependencies
  • ✅ Support for x86_64 and ARM64 architectures

Usage

  1. Run sleepnomore_amd64.exe (for Intel/AMD processors) or sleepnomore_arm64.exe (for ARM processors)
  2. The icon will appear in the system tray (near the clock)
  3. Click the icon to toggle awake mode on/off
  4. Right-click to access the context menu

Development

Prerequisites

  • Go 1.21 or higher

Building from Source

Windows

build.bat

Linux/Mac (cross-compile for Windows)

chmod +x build.sh
./build.sh

Local Quality Checks

Before pushing code, run local quality checks to replicate the same checks performed in GitHub Actions:

Full Check (Complete Analysis)

# Windows Bat
check.bat

# PowerShell (Windows/Linux/Mac)
pwsh check.ps1

Quick Check (Fast Basic Validation)

# Windows Batch
quick-check.bat

# PowerShell with options
pwsh check.ps1 -Quick          # Quick mode
pwsh check.ps1 -Verbose        # Detailed output
pwsh check.ps1 -NoColor        # No colors (CI-friendly)

The local checks include:

  • Code formatting (gofmt, goimports)
  • Static analysis (go vet, staticcheck)
  • Linting (golangci-lint with project config)
  • Security scanning (gosec)
  • Test execution with coverage reporting
  • Code complexity analysis (cyclomatic, cognitive)
  • Build verification (AMD64, ARM64)
  • Dependency verification (go mod verify/tidy)

Running Tests

# All tests with coverage
go test -v -coverprofile=coverage.txt -covermode=atomic ./...

# Quick tests only
go test -short ./...

# Integration tests (requires Windows and integration build tag)
go test -tags=integration ./...

# Benchmarks
go test -bench=. -benchmem ./...

Output Files

  • sleepnomore_amd64.exe - Windows x86_64 (Intel/AMD)
  • sleepnomore_arm64.exe - Windows ARM64

How It Works

The application uses the Windows API SetThreadExecutionState to prevent the system from entering sleep mode, keeping both the system and display active when the mode is enabled.

License

MIT License - feel free to use this project for any purpose.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Lightweight Windows system tray application that prevents your computer from entering sleep mode. Single binary, no dependencies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published