provide-module niri %~ # ensure we're actually in niri evaluate-commands %sh{ [ -z "${kak_opt_windowing_modules}" ] || [ -n "$NIRI_SOCKET" ] || echo 'fail NIRI_SOCKET is not set' } require-module wayland alias global niri-terminal-window wayland-terminal-window define-command niri-terminal-vertical -params 1.. -docstring ' niri-terminal-vertical []: create a new terminal as a Niri window and consume it into the current column The program passed as argument will be executed in the new terminal' \ %{ wayland-terminal-window %arg{@} # niri always opens new windows to the right # and only allows operations on focused windows nop %sh{ niri msg action focus-right niri msg action consume-or-expel-window-left } } complete-command niri-terminal-vertical shell define-command niri-terminal-horizontal -params 1.. -docstring ' niri-terminal-horizontal []: create a new terminal as a Niri window and consume it into the column on the right The program passed as argument will be executed in the new terminal' \ %{ wayland-terminal-window %arg{@} # niri always opens new windows to the right # and only allows operations on focused windows nop %sh{ niri msg action focus-right niri msg action consume-or-expel-window-right } } complete-command niri-terminal-horizontal shell define-command niri-new-vertical -params .. -docstring ' new []: create a new Kakoune client and consume it into the current column The optional arguments are passed as commands to the new client' \ %{ wayland-terminal-window kak -c %val{session} -e "%arg{@}" # niri always opens new windows to the right # and only allows operations on focused windows nop %sh{ niri msg action focus-right niri msg action consume-or-expel-window-left } } complete-command -menu niri-new-vertical command define-command niri-new-horizontal -params .. -docstring ' new []: create a new Kakoune client and consume it into the column on the right and consume it into the column on the right The optional arguments are passed as commands to the new client' \ %{ wayland-terminal-window kak -c %val{session} -e "%arg{@}" # niri always opens new windows to the right # and only allows operations on focused windows nop %sh{ niri msg action focus-right niri msg action consume-or-expel-window-right } } complete-command -menu niri-new-horizontal command ~