Skip to content

How to switch to workspace number N and how to move window to workspace number N #860

Answered by urob
marc-hg asked this question in Q&A
Discussion options

You must be logged in to vote

No need to recompile Whim. As alluded to above, you can use custom commands to implement this in user space. Here's a simplified version that moves the current window to workspace 1:

// Add this at the top of your csx file where the other using directives are
using System.Linq;

// Add the below inside the DoConfig function inside your csx file

// Create the custom command
context.CommandManager.Add(
    identifier: "move_window_to_workspace_1",
    title: "Move window to workspace 1",
    callback: () =>
    {
        int Index = 1;  // use a fixed index as proof of concept
        IWorkspace[] workspaces = context.WorkspaceManager.ToArray();
    if (Index <= workspaces.Length)
    {

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@marc-hg
Comment options

@urob
Comment options

@marc-hg
Comment options

@urob
Comment options

Answer selected by marc-hg
@urob
Comment options

@marc-hg
Comment options

@urob
Comment options

@marc-hg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants