Utility for toggling display state in sway
Find a file
2025-05-12 17:18:43 +03:00
src clean up 2025-05-12 17:15:01 +03:00
.gitignore initial commit 2025-05-12 16:31:39 +03:00
Cargo.lock initial commit 2025-05-12 16:31:39 +03:00
Cargo.toml initial commit 2025-05-12 16:31:39 +03:00
README.md update readme with examples 2025-05-12 17:18:43 +03:00

A program to toggle the power state of all displays in sway.

This program will:

  1. Enumerate all enabled displays
  2. If off or on isn't manually provided, determine if displays are mostly on or off
  3. Toggle displays to the opposite state

Mostly only useful if combined with an idle daemon like swayidle, or when assigned to a keybinding.

Usage:

# toggle all outputs
sway-powertoggle

# turn off displays that are on
sway-powertoggle off

# turn on displays that are off
sway-powertoggle on