lightsout

Lights out.

One command asks every open app to quit, the polite way, and keeps the terminal you're in. macOS, Linux and Windows.

$ brew install abhisheksinha1506/tap/lightsout

Windows: Scoop or a download · Linux: .deb, .rpm or Homebrew · Free and MIT-licensed

Featured on LaunchStall Featured on MegaLaunch

$ lightsout

The end of the day, in one keystroke.

Fifteen apps open, three of them hiding unsaved work. Closing them one by one is tedious; force-quit scripts are dangerous. lightsout does it the way you would, just all at once.

It asks. It never forces.

Every app gets the same request as Cmd+Q or its close button. If one wants you to save, it asks you, and lightsout leaves it alone.

  • Apps still open after the timeout are listed at the end, never killed
  • Exits with status 1 when anything is left, so scripts can tell
Terminal — zsh
~ $ lightsout✔ Keeping Terminal open (you're running lightsout from it) ✔ Quit Figma✔ Quit Mail◈ WARNING ◈Failed to quit Notes: still open; it may be waiting for you to save✔ Quit Slack✔ Quit Spotify✔ Closed all Finder windows ✗ failed to quit: Notes
Illustration of a real run. App names are examples.

Knows which window you're in.

lightsout follows its own parent processes, from your shell up to the terminal or editor that started it, and keeps that app open without asking. Terminal, iTerm2, VS Code, Windows Terminal: it works it out.

  • Over SSH or inside tmux it can't tell, so it asks you instead
  • Type 0 when that app is already kept open
tmux — ssh studio-mac
~ $ lightsoutWhich app are you running lightsout from?1) Figma2) iTerm23) Mail4) Slack0) None of these (the app I'm running from is already kept)Enter a number (0-4): 2 ✔ Quit Figma✔ Quit Mail✔ Quit Slack
Illustration: the fallback question, shown only when detection can't tell.

Look before you leap.

--dry-run lists exactly what would be asked to quit, and quits nothing. Run it the first time, or any time you're not sure.

Terminal — zsh
~ $ lightsout --dry-run✔ Keeping Terminal open (you're running lightsout from it) Dry run: these apps would be asked to quit:  • Calendar  • Figma  • Mail  • Notes  • SlackIt would also close all Finder windows.Nothing was quit.
Illustration of lightsout --dry-run.

Keep what you always keep.

Music playing, a browser full of tabs: tell lightsout once and it never touches them again. Or keep an app for just one run by naming it.

  • lightsout keep and unkeep edit your config for you
  • lightsout Slack "Google Chrome" keeps them this time only
Terminal — zsh
~ $ lightsout keep Spotify "Google Chrome"✔ Always keeping open: Spotify, Google Chrome ~ $ cat ~/.config/lightsout/config.ymlignoredApps:    - Spotify    - Google Chrome ~ $ lightsout unkeep Spotify✔ No longer always keeping open: Spotify
Illustration of keep and unkeep.

Put it on a schedule.

With --yes, lightsout never stops to ask. If it can't tell which app it's running from, it refuses and quits nothing, so a 7 pm cron job can't close the wrong thing. --timeout gives slow apps longer.

crontab -l
# Lights out at 7 pm on weekdays0 19 * * 1-5  lightsout --yes --timeout 30 ~ $ lightsout --yes✗ couldn't tell which app you're running lightsout from, so nothing was quit.  Run it without --yes to choose, or keep that app with: lightsout keep <app> ~ $ lightsout --timeout 0lightsout: --timeout must be a whole number of seconds from 1 to 300, not "0"
Illustration: a schedule, and the two safety stops.

Same command on every desk.

Each platform is asked in its own native way, and each is tested end to end in CI on every change: TextEdit on macOS, an xterm on Linux, Notepad on Windows.

  • macOS: Dock apps by process ID, then Finder windows
  • Linux: app windows through wmctrl on X11
  • Windows: taskbar apps through WM_CLOSE, then File Explorer
Terminal — zsh
~ $ lightsout
✔ Keeping Terminal open (you're running lightsout from it)

✔ Quit Calendar
✔ Quit Preview
✔ Quit Safari
✔ Closed all Finder windows

✔ Quit All Applications! Have a good day :)
Illustrations. App names come from each system: Dock names, window classes, program descriptions.

Feels at home in your shell.

Tab completion for bash, zsh, fish and PowerShell, and a proper man page. Homebrew and the Linux packages install both; elsewhere one line sets it up.

Terminal — zsh
~ $ lightsout ----dry-run  -- show what would be quit--help     -- show help--timeout  -- seconds to wait for each app--version  -- show the version--yes      -- do not ask which app you are running from ~ $ man lightsoutLIGHTSOUT(1)            User Commands            LIGHTSOUT(1)NAME     lightsout - politely quit every open app with one command
Illustration of zsh completion and the man page.

Signed, and you can check.

Every release records where it was built, and the checksums are signed with cosign by the release workflow itself. Open source, with SBOMs for every download.

  • Build provenance: gh attestation verify
  • Signature: cosign verify-blob on the checksums
  • Scanned by CodeQL, govulncheck and OpenSSF Scorecard
Terminal — zsh
~ $ gh attestation verify lightsout_1.2.0_darwin_arm64.tar.gz \    --repo abhisheksinha1506/lightsout✓ Verification succeeded! ~ $ cosign verify-blob --bundle lightsout_1.2.0_checksums.txt.sigstore.json \    --certificate-identity-regexp '(?i)^https://github.com/abhisheksinha1506/lightsout/' \    --certificate-oidc-issuer https://token.actions.githubusercontent.com \    lightsout_1.2.0_checksums.txtVerified OK
Illustration of verifying a v1.2.0 download.

Install in a minute.

One small binary, no runtime. On Linux it uses wmctrl and xprop, which the packages install for you.

Then try lightsout --dry-run first. It quits nothing.

$ brew install abhisheksinha1506/tap/lightsout

macOS and Linux. Installs the man page and shell completions.

Questions.

Will I lose unsaved work?

No. lightsout sends the same request as choosing Quit or clicking the close button, so apps can ask you to save. Anything still open after the timeout is left running and listed at the end. Nothing is ever force quit.

Which apps does it close?

On macOS, the apps in your Dock (menu bar helpers and system processes are left alone). On Linux, apps with open windows. On Windows, apps on the taskbar. The app you run it from, and any apps you keep, stay open.

Why does macOS ask whether my terminal may control Finder?

lightsout closes Finder's windows with AppleScript, which macOS asks you to allow once. Quitting other apps needs no permission.

Does it work on Wayland?

Only for apps running through XWayland. Native Wayland apps can't be listed by another program, and lightsout warns you in a Wayland session.

Windows says “Windows protected your PC”.

lightsout isn't code-signed for Windows yet, so SmartScreen warns the first time. Choose More info, then Run anyway. Every release has signed checksums and build provenance you can verify.

Is it free?

Yes. lightsout is open source under the MIT license, and bug reports and pull requests are welcome on GitHub.

Call it a day.

Try a dry run now. It shows what lightsout would close, and closes nothing.

$ brew install abhisheksinha1506/tap/lightsout

Featured on

lightsout on Nick Launches Launch Llama Tools Lights out on Verified Tools — AI & SaaS tools directory Featured on Yo.directory Launched on LaunchPanda LaunchLeague Badge Featured on Toolhunter Launched on Launch Streak Good AI Tools Featured on SumoDir Launched on MarketingDB Featured on Wayfindio Featured on Toolfio lightsout — quit every open app with one command on StartupTrusted Featured on toolfame.com Featured on saasfame.com Featured on DodoDirectory Featured on NewTool.site Featured on CloutStack Launchpadly Startup Directory Featured on TinyShelf Listed on Uno Directory Featured on SaaSBison lightsout is listed on publishyoursaas Featured on EasyDoFollow Featured on EasyLaunch Featured on LemonLaunch Featured on Buildlist Launched on LaunchBoard - Product Launch Platform Featured on ListBulb lightsout - Featured on Launchit Featured on ufind.best Feature On Launch Vault lightsout — Featured on Smol Launch lightsout on LiftOff Badge Featured on CodeHype Listed on Turbo0 Featured on LaunchIgniter Featured on LaunchKiwi lightsout on LaunchNest Featured on DanielLaunches Listed on SaaS Cubes Featured on DevHub Featured on BestskyTools Featured on ListMySaaS Featured on neeed.directory Featured on Brick Launch