johannesjo / linux-window-session-manager

A tool to store and reload open windows and window positions for x11 desktops like unity and gnome.
MIT License
393 stars 25 forks source link

[Question] Does this project handle the case of moving a window to the specified workspace? #76

Open nlpsuge opened 4 years ago

nlpsuge commented 4 years ago

Hi,

I'm writing a similar tool named xsession-manager in Python.

And I'm struggling deal with adding enough Workspaces before moving windows to the specified workspace where those windows stayed in last time when restoring.

I've asked many people including Florian Müllner from the Gnome Team. I learned from them that there no way to add Workspaces outside of Gnome Shell itself via some APIs.

Now I can add Workspaces via org.gnome.desktop.wm.preferences num-workspaces and org.gnome.mutter dynamic-workspaces, but it's not recommended.

How do you deal with this case?

johannesjo commented 4 years ago

Hi there! lwsm deals with it by moving the windows ins sequence. If you move a window to the current amount of workspaces +1 then a new workspace is created.

I wonder however why you want to rebuild this completely in Python. In case you want to extend the functionality, you can either extend on this module via a PR or include it in your own.

nlpsuge commented 4 years ago

lwsm deals with it by moving the windows ins sequence. If you move a window to the current amount of workspaces +1 then a new workspace is created.

That 's great! I'll learn how this project handle it later. Maybe I'll ask you more questions.

I wonder however why you want to rebuild this completely in Python.

I write it in Bash at first perhaps before I know your project. The Bash version just works but is not flexible and difficult to extend. Some issues are not easy to be addressed.

Python is better than Bash to do this kind of work for me, I can add more features easily. I'm learning Python, so that project is also a practice.

In case you want to extend the functionality, you can either extend on this module via a PR or include it in your own.

I'll see what I can do. I know a little about js by the way.

nlpsuge commented 4 years ago

If you move a window to the current amount of workspaces +1 then a new workspace is created.

I've tested. lwsm cannot move windows to the the current amount of workspaces +1 + N (N is equal to 1 or greater than 1).

Move windows to the last one of workspace, then check the amount and move again is a plausible way though... :)