I suppose there could be an API like move_window_and_change_to_space that would do the same as when you move a window with the hotkey. Is that what you wish for?
No, I just want to move windows to other space without switching space at the same time;
for example: A message received when I am writing email, and I need to reply this message right now,
and then I would throw away the msg window to other window after done this;
current_space = TotalSpaces2.current_space
windows = TotalSpaces2.window_list
if current_space < 4
dest_space = current_space + 1
else
dest_space = 1
end
if !windows.empty?
current_space_windows = windows.select {
|window| window[:space_number] == current_space
}
if current_space_windows[0]
TotalSpaces2.move_window_to_space(
current_space_windows[0][:window_id], dest_space)
if current_space_windows[1]
TotalSpaces2.set_front_window(current_space_windows[1][:window_id])
end
end
end
Ok, that’s clear, thanks. I will think about it. Possibly the API could offer control of the position of the window, so you could do whatever animation you want yourself.