Skip to content

Instantly share code, notes, and snippets.

@sermuns
Last active December 2, 2025 19:07
Show Gist options
  • Select an option

  • Save sermuns/cdbf6f18c801a0c2ef4c26588a31467b to your computer and use it in GitHub Desktop.

Select an option

Save sermuns/cdbf6f18c801a0c2ef4c26588a31467b to your computer and use it in GitHub Desktop.
Command+keybind to toggle Niri output scale

By running

OUTPUT=$(niri msg --json focused-output); niri msg output $(echo $OUTPUT | jq -r .name) scale $([ $(echo $OUTPUT | jq .logical.scale) = 1.0 ] && echo 2.0 || echo 1.0)

the current output's scale is toggled between 1.0 and 2.0.

Can be bound to a keystroke like this:

e.g. Mod+Shift+U:

    Mod+Shift+U repeat=false {
        spawn-sh "OUTPUT=$(niri msg --json focused-output); niri msg output $(echo $OUTPUT | jq -r .name) scale $([ $(echo $OUTPUT | jq .logical.scale) = 1.0 ] && echo 2.0 || echo 1.0)"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment