MyNixOS website logo
option

wayland.windowManager.sway.config.bindswitches

Binds <switch> to execute the sway command command on state changes. Supported switches are lid (laptop lid) and tablet (tablet mode) switches. Valid values for state are on, off and toggle. These switches are on when the device lid is shut and when tablet mode is active respectively. toggle is also supported to run a command both when the switch is toggled on or off. See sway(5).

Declarations
Type
attribute set of (submodule)
Default
"No bindswitches by default"
Example
let
  laptop = "eDP-1";
in
{
  "lid:on" = {
    reload = true;
    locked = true;
    action = "output ${laptop} disable";
  };
  "lid:off" = {
    reload = true;
    locked = true;
    action = "output ${laptop} enable";
  };
}