Replies: 2 comments 4 replies
|
It will work if you enable empty-workspace-above-first |
3 replies
|
If I understand correctly, this could be done using the IPC. It's a bit awkward, but you can take the last empty workspace, move it to index 0 and then move your window/column into that. Kinda breaks workspace indexing, but maybe it makes sense for some setups? Here's a bash script for doing it for a single window. Moving a whole column should be mostly the same (but without the need to check the row index I think) except using the #!/bin/bash
# Only make new workspace & move if we're on workspace index 1, row 1
CURR_WS_IDX=$(niri msg -j workspaces | jq '.[] | select(.is_focused == true)' | jq .idx)
if [ "$CURR_WS_IDX" -ne 1 ]; then
# Here we're not on workspace 1, so just move up normally
niri msg action move-window-up-or-to-workspace-up
else
WIN_ROW_IDX=$(niri msg -j focused-window | jq .layout | jq .pos_in_scrolling_layout | jq '.[1]')
if [ "$WIN_ROW_IDX" -eq 1 ]; then
# Here we're on workspace 1, row 1, so make an empty workspace above to move into
NUM_WS=$(niri msg -j workspaces | jq 'length')
niri msg action set-workspace-name _tempws --workspace $NUM_WS
niri msg action move-workspace-to-index 1 --reference _tempws
niri msg action move-window-to-workspace _tempws
niri msg action unset-workspace-name _tempws
else
# Here we're on workspace 1, but not row 1, so just move up the column
niri msg action move-window-up
fi
fiYou'd just need to save this to a file and then call it with your 'move up' keybind. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In overview mode, I can move a window with the mouse (or the touchpad) above the first workspace, and by releasing it, create a new workspace above it (and which becomes the new first workspace). But I can't do it with the keyboard: I can move a window to a workspace below or above if that workspace already exists, but not to this workspace above the first which doesn’t yet exist.
The keyboard/touchpad context switches are quite inexpensive for me on my laptop, but the same is not the case on my desktop computer to switch from my Ferris to my trackball, and vice versa. That’s why I would appreciate it if this action could also be performed from the keyboard, so as not to have to leave it if I am using it. It's a small detail, but all small improvements are good to take, , aren't they?
All reactions