-
Stupid question but I can't figure out how I configure moving the active window on desktop 1 to desktop 2 for example. I found MoveWindowToAdjacentWorkspace but I am no programmer..... |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
Not a stupid question at all! There are a few ways to achieve this. I'm not entirely which scenario you were referring to, so I'll try cover them all. Move a window to an adjacent monitorThere are the commands Move a window to a specific workspacesThere are two approaches to this:
Move window to monitor indexI've made a new release of Whim v0.7.8-alpha which adds an API to make it slightly easier to move windows to a specific monitor. You can add this to your // NOTE: The 2nd monitor has index 1 due to 0-based indexing (the first item has index 0).
context.CommandManager.Add("move_window_to_monitor_2", "Move window to monitor 2", () =>
{
context.Store.Dispatch(new MoveWindowToMonitorIndexTransform(1));
});
context.KeybindManager.SetKeybind(
"whim.custom.move_window_to_monitor_2",
new Keybind(KeyModifiers.LWin | KeyModifiers.LControl, VIRTUAL_KEY.VK_2)
); The monitors are ordered by their x-coordinate and then by their y-coordinate. Your primary monitor will have the top-left coordinate be (0, 0). Accordingly, monitors to the left of the primary monitor will have negative x-coordinates, and monitors above the primary monitor will have negative y-coordinates. This would've been possible from the config using C# without this API, but I thought it'd be worth adding. |
Beta Was this translation helpful? Give feedback.
-
Hi! Thanks for the quick reply! And thanks for this awesome project. I actually tried the first two suggestions already but nothing happens when I press win+shift+RIGHT or use the Command Palette. Regarding option 3 "Move window to monitor index" I get that I add this code to the whim.config.csx but I don't understand where I then store the commands "whim.custom.move_window_to_monitor_2". I tried some other tiling window managers, non as awesome as this, and they all had a separate config file for keybindings. Ah are the commands stored in the source? Ok yes I understand, it is. So I need to pull the source, edit the Commands file and build it? |
Beta Was this translation helpful? Give feedback.
-
Yes, some commands work like switching to specifik desktop or focus window. Nothing in the log. I have tested to place the code you gave me in the config file and the stop and start whim but nothing happens.
|
Beta Was this translation helpful? Give feedback.
-
Ah ok yes I mean virtual desktop. I use Hyperland on my personal Linux box and there you can move a window from a virtual desktop to another with keybindings. That was what I was after :/ |
Beta Was this translation helpful? Give feedback.
-
OK so is there a way to accomplish what I am after with Whim or should I add this as a request? |
Beta Was this translation helpful? Give feedback.
-
Ok that works great. Then my next question, is it possible to make a keybinding for this, say LAlt+LCTRL+number? |
Beta Was this translation helpful? Give feedback.
Good idea @urob.
@ms4ndst, I've added a snippet to the docs to move a window to a workspace - see https://dalyisaac.github.io/Whim/docs/customize/snippets.html#move-a-window-to-a-specific-workspace. Hopefully this helps.
The snippet requires the latest release (
v0.7.9-alpha+895c46db
) as it relies on a change I just made.