Skip to content
Discussion options

You must be logged in to vote

ok thanks @YaLTeR and @Sempyos

I made this script :

#!/usr/bin/env bash

WINDOW_JSON=$(niri msg --json focused-window)
IS_FLOATING=$(echo "$WINDOW_JSON" | jq '.is_floating')

niri msg action set-column-width $1;

if [ "$IS_FLOATING" == "true" ]; then
 niri msg action center-window
fi

after put this in my niri config:

    Mod+Equal { spawn-sh "~/Code/nixos-config/scripts/center-after-resize.sh +10%"; }
    Mod+Minus { spawn-sh "~/Code/nixos-config/scripts/center-after-resize.sh -10%"; }

Probably not the most elegant way but it seems to work.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Sempyos
Comment options

Sempyos Dec 18, 2025
Collaborator

Comment options

You must be logged in to vote
0 replies
Answer selected by mrflos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants