6 releases

0.4.6 Feb 28, 2024
0.4.5 Feb 28, 2024

#146 in GUI

MIT license

1.5MB
203 lines

monoff monoff - Turn off your monitors on Windows

GitHub download count Latest GitHub release Crates.io

monoff is a Windows program that turns off/sleeps your monitors – that's it.

  • Simple: There's no magic to it. It works the same way as if you'd left your computer inactive for however many minutes. Run it, and the monitors turn off. Then, move your mouse, they'll turn back on again. No GUI, no administrator privileges, no background processes.
  • Portable: Everything about it is self-contained in the .exe and does not require an installer. You can even run it from a USB stick.
  • Convenient: Just click an icon in your taskbar, or press a keyboard shortcut. I made this program because the power button on my monitors is hard to reach.
  • Safe: This program is open-source. You can inspect the code and build it yourself.

You can also specify a delay before the monitors turn off, so that you can safely remove your hand from your mouse, for example. It defaults to 100 milliseconds.

Installation

From GitHub (easiest)

Download monoff.exe from the latest release and put it somewhere, such as on your Desktop.

Running it is then as simple as double-clicking it.

Run:

scoop bucket add t-mart https://github.com/t-mart/bucket
scoop install t-mart/monoff

This will:

  • put monoff in your PATH variable
  • place the executable at %UserProfile%\scoop\apps\monoff\current\monoff.exe
  • create a Start Menu item

Cargo

Run:

cargo install monoff

This will build the executable and place it at %UserProfile%\.cargo\bin\monoff.exe (and, most likely, put it in your PATH variable).

Binstall

You can also use binstall to install the latest GitHub release without needing to build. Run:

cargo binstall monoff

Making it a taskbar shortcut

As normal, just drag the application to your taskbar:

add to taskbar

From here, you can just click to icon the turn off your monitors.

Adding a hotkey/keyboard shortcut

Expand

To run the application when you press a hotkey/keyboard shortcut, edit the Shortcut Key value in its properties:

edit shortcut arguments

Note that Windows will automatically prefix your choice with Ctrl + Alt. You only can only provide the last key.

Adding a delay

Expand

The default delay (50ms) is fine in most cases. But, if you want to change the delay to this shortcut, edit the Target value in its properties to add the delay option:

edit shortcut arguments

Usage examples

  • Turn off your monitors immediately:

    monoff.exe
    
  • Turn them off after a delay of 2 seconds:

    monoff.exe --delay 2000
    
  • See help:

    monoff.exe --help
    

Thanks

This program is heavily inspired by lcdoff-rs (and its partner article). Thank you, @Gekkio!

Other Projects Named monoff

After creating this monoff project, I found that there are several others with the same name. To keep things clear, these are the only pages directly connected to this project:

DevOps

To:

  • create and push a new git tag,
  • create a new GitHub release with binaries attached, and
  • publish a new version to https://crates.io (and update docs on https://docs.rs)

simply push a commit to the master branch with an updated version number in Cargo.toml. The workflow file at .github/workflows/release-build-publish.yml will take care of the rest. Make sure to pull afterwards.

Dependencies

~128MB
~2M SLoC