I work with lots of terminals open on many virtual desktops; each desktop given a meaningful name to make it very easy to multitask.
My problem is that I lose the virtual machine I am running on over the weekends. It is the policy of my system administrator that we will lose our current virtual machine if it is inactive for more than 11 hours; and this means the weekend.
So, every Monday, I have to start from scratch, manually re-opening all my terminals and moving them to the correct desktops to continue where I left off on Friday. I want to write a script to do this for me automatically.
For a given terminal number, e.g. terminal 4, is there a command line expression that will tell me which virtual machine this terminal is open on? For example, it might look something like
which might return the number 7, telling me that terminal 4 is open on desktop 7. Is there such a command?
Also, a companion question would be the following: is there a command line expression that I can use, to open up a new terminal and get it to open up on a specified desktop? For instance, this might look something like:
which would then open up a new terminal an place it on desktop 7. Is there such a command?
I imagine there is in fact no way to do what I am asking, but that would be a shame because it would make using virtual desktops so much more efficient: if I could automate the process of remembering the terminal/desk layout on Friday, and then automatically reopening these terminals on their correct desktops on Monday morning (when I open a session on a new virtual machine). I would have thought there should be a way to do this, as it is one of the most obvious thing that a user with many terminals and desktops would want to do.
Unfortunately, simply keeping my virtual machine is not an option. It is the policy of my system administrator that we will lose our current virtual machine if it is inactive for more than 11 hours; and this means the weekend.