-
How would I move the currently selected window on any workspace to the lowest numbered empty workspace? Can it also switch to the workspace that the window is moved to? For example, Let's say I run the the desired code on a new instance of my browser while I am on workspace 5. The desired behavior is that xmonad moves my browser window to workspace 3 because 1 and 2 are occupied. Now I close msn.com on workspace 1 so that all I have is: Assuming I am on workspace 3 currently and I hit the shortcut key, my browser window and me should immediately move to workspace 1 because it is lower than 3 and it is currently empty. Let me know if this is clear or not. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 17 replies
-
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 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. |
Beta Was this translation helpful? Give feedback.
-
Is there anyway I can upgrade to the latest version? I don't have any
version constraints set and I am running pacman package manager on Arch
Linux
…On Thu, Jan 20, 2022, 1:25 PM brandon s allbery kf8nh < ***@***.***> wrote:
Sigh, that's right, you're still on 0.15. You want EmptyWS instead of
emptyWS.
—
Reply to this email directly, view it on GitHub
<#369 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTB5TORVNLIFDD6XYYN5STUXBHQVANCNFSM5ML3HS6A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Basically it works, but it is taking me to the last workspace available and empty instead of the first one
On Thu, Jan 20, 2022 at 11:08:24AM -0800, brandon s allbery kf8nh wrote:
|
Beta Was this translation helpful? Give feedback.
-
Ok thank you I changed the `Prev` to `Next` and that functionality is close to what I am looking for. Thanks!
|
Beta Was this translation helpful? Give feedback.
-
I was thinking that this may work if I use the existing code:
But added to the algorithm. If before it does the above step, it always moves the window to workspace 9, it will always go to the next available window that is closest to 1 or is 1. For example, let's say that the target window is on workspace 3. I have a window open on workspace 2. There is also a window open on workspace 1. And one open on workspace 9. If I closed the one on 2, and run the code, it would ideally send the window to workspace 9 (This is the part I need help with) who is already populated. Once there, the code from figure 1 would skip 1 because it is populated. 2 is not populated now since I closed it. The window will land on 2. Thus it started on 3, a workspace greater than 2 but was able to land back a window, keeping it as close as possible to 1. It would be a nice algorithm if I can get some help on how to send the window to 9, then run figure 1's code. |
Beta Was this translation helpful? Give feedback.
-
Sorry, forgot you're still on 0.15, and 0.17.0 throws deprecation warnings with And I was afraid of it not working; I suspect it's got to shift you to workspace 9 for the
|
Beta Was this translation helpful? Give feedback.
-
Wow it works beautifully! Thank you for your help! Great work!! It does EXACTLY what I was looking for! You really understood the problem. Thank you
|
Beta Was this translation helpful? Give feedback.
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
view
ing 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
Note that I have not tested this and it may not be quite what you want.