Skip to content

Move a window to the next lowest numbered empty workspace #369

Answered by geekosaur
wgmayer0 asked this question in Q&A
Discussion options

You must be logged in to vote

XMonad.Actions.CycleWS supports much of what you want, although it would select the first empty workspace in the direction you specify (so if you have two empty workspaces before workspace 5 it would select the second instead of the first). The operations it provides only do one or the other of moving the window or viewing the workspace, but it also provides a more general function that would let you do both at once.

The thing you'd bind to your chosen key would look something like

doTo Prev emptyWS (\ws -> withFocused (\w -> windows (W.view ws <> W.shiftWin ws w)))

Note that I have not tested this and it may not be quite what you want.

Replies: 8 comments 17 replies

Comment options

You must be logged in to vote
11 replies
@wgmayer0
Comment options

@geekosaur
Comment options

@geekosaur
Comment options

@wgmayer0
Comment options

@geekosaur
Comment options

Answer selected by slotThe
Comment options

You must be logged in to vote
1 reply
@geekosaur
Comment options

Comment options

You must be logged in to vote
1 reply
@geekosaur
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@wgmayer0
Comment options

@wgmayer0
Comment options

@geekosaur
Comment options

Comment options

You must be logged in to vote
1 reply
@wgmayer0
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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