How can I send a window to a different workspace without changing the active workspace?
Solution 1:
I am not using Gnome right now, but I see under Focus or open window in gnome on keyboard shortcut that wmctrl works with Gnome.
So, I paste from an answer under the question you linked (on Xfce):
Move active window to workspace 1:
wmctrl -r :ACTIVE: -t 0
Move active window to workspace 2:
wmctrl -r :ACTIVE: -t 1
Move active window to workspace 3:
wmctrl -r :ACTIVE: -t 2
Etc...
Solution 2:
As per the linked QA
wmctrl -r :ACTIVE: -t 0 // Move active window to workspace 1 wmctrl -r :ACTIVE: -t 1 // Move active window to workspace 2 wmctrl -r :ACTIVE: -t 2 // Etc...
Building upon that, here's a command using wmctrl that sends the currently active window to the next workspace (relative), without changing the currently active workspace.
wmctrl -r :ACTIVE: -t $((1+$(wmctrl -d | awk '{ if ($2 == "'*'") print $0}' | awk '{print substr($0,1,1)}')))
To create a shortcut for a command is actually quite simple: Open "Settings" > "Devices" > "Keyboard" and scroll down to add a shortcut.
If the shortcut does not work in that way, but the command works when run from the terminal, save it in a file /fullpath/myfile.txt
and set bash /fullpath/myfile.txt
as the shortcut command. That should work both on Gnome and Xfce.