Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: "Move windows to next/previous desktop" #6

Open
riotrah opened this issue Dec 25, 2021 · 1 comment
Open

Request: "Move windows to next/previous desktop" #6

riotrah opened this issue Dec 25, 2021 · 1 comment

Comments

@riotrah
Copy link

riotrah commented Dec 25, 2021

Great work here firstly - appreciate your sharing it.

The "move window to desktop number " is awesome, but I wonder if it would be possible to add "move to next/previous vd". This would match the "move to next/previous monitor" hotkeys already present natively in Windows ( and would help me switch between mac/win everyday as I have to for work! )

Thanks again.

Any tips on how I may implement this myself without needing to add another function on your part would also be appreciated!!

@adrian88888888
Copy link
Owner

Hi!

Put your best to understand it, and then feel free to ask me anything you don't get
Btw I stopped coding and now im returning(sorry for the late response), so i'm pretty sure there's something wrong with the grammar, I forgot stuff
So this is how I would do:

MoveCurrentWindowToNextDesktop(){
  currentDesktop := GetCurrentDesktop()
  nextDesktop := currentDesktop + 1
  amountOfDesktops := GetAmountOfDesktops()
  if nextDesktop =< amountOfDesktops
    MoveCurrentWindowToDesktop(nextDesktop)
  else
    msgbox, theres not a next desktop
}

MoveCurrentWindowToPrevDesktop(){
  currentDesktop := GetCurrentDesktop()
  prevDesktop := currentDesktop - 1
  if prevDesktop <= 1
    msgbox, theres not a previous desktop
  else
    MoveCurrentWindowToDesktop(prevDesktop)
}

If you make it work, share your code here so everyone can see it(including me because i'm curious)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants