YaLTeR/niri

Multiple actions for a single bind

Closed this issue · 3 comments

System Information

  • niri version: 0.1.5
  • Distro: Fedora Immutable (Aurora)
  • GPU: Intel Graphics
  • CPU: N2840 (it works fast on this celeron, thanks niri dev)

So... this doesn't work: Super+Alt+L { spawn "swaylock" ; power-off-monitors; } . I want to be able to lock my laptop/PC and turn off it's screen at the same time, not using two different binds (in this case Super+Alt+L and Mod+Shift+P). It's not a bug its a feature? I mean you implemented cooldowns for Mod+TouchpadScroll right? Multiple actions for a single bind seems like a no-brainer. There's nothing about it on the wiki huh

Also a little question: KDL it's supposed to be better right? Then why I always need to end curly braces with ; ? . I mean why? The dude had written a new standard only to fail at something really basic lol. Well, my little rant ends here.

🇵🇪 Peru mentioned 🇵🇪

This is not a bug, multiple actions per bind are not supported at the moment. You can work around this by making a shell script that spawns a screen locker, then calls niri msg action power-off-monitors.

well, I'll try that hack, thanks.

nirilock.sh

swaylock &
niri msg action power-off-monitors

Add to config.kdl

binds {
    ...
    Super+Alt+L { spawn "~/.config/niri/nirilock.sh"; }
    ...
}