Reboot causes number of spaces to converge on monitor 1

The docs are here

http://binaryage.github.io/totalspaces2-api/ruby/rdoc/TotalSpaces2.html

Actually I was thinking of writing such a script as a demo to test whether we can successfully restore desktops when you plug a monitor in - the API has everything needed I think.

Well, that has the docs for writing the script, but not for actually using the script. I have no idea for what to do with the script once its written.

Ah ok.

Well you can just run using

ruby scriptname

in the terminal.

If you want to package it as an app, then Platypus is a good bet:

http://sveinbjorn.org/platypus

Ah. Thanks

For me, the problem doesn’t seem to happen when I unplug and re-plug a monitor. It doesn’t even happen every single time :frowning:
I do think the space ID’s change, because sometimes I DO get the same amount of spaces, but I don’t get the same backgrounds for all spaces. It just defaults to an ocean theme for several spaces.
When exactly does this happen? I’m not sure tbh. I think it’s always after a reboot, but for sure it’s after a reboot where I did not use the exact same monitor configuration. SO… using 3 monitors with 4 spaces each… then power off. Next time just use the laptop screen with all spaces on it (so 12 spaces). Power off. Next time I use more monitors, something gets lost in translation, but it seems a bit random. The very best option for me would be if TS can remember which space belongs where on which monitor. If that can be done and restored if the system messes it up again it would be awesome :smiley:

I have to amend my previous statement. It seems that plugging and unplugging does more harm than a reboot. Since this is very important to me I tested some more and found this to be the case:
I set up 3 new monitors. Each with 4 spaces and each space with a non-standard desktop image. When I shutdown and them startup with just the laptop screen, I see 10 out of 12 spaces. I don’t care that they’re all on one monitor, but it’s weird that I’m now missing 2.
The magic happens when I now plug in the monitors again… I get 1 of the original spaces on each monitor and they each have 3 spaces with a default desktop image, so I assume those are new. I have 12 in total.
Now I disconnect one of the monitors and the laptop screen gets 7, not 8 spaces. I think a reboot just creates the same problem as plugging and plugging monitors, but I didn’t notice that much because of the time in between uses. I also suspect having a monitor plugged in when I boot or plugged in after the boot makes a difference.
I will do the plugging and unplugging while running your ruby script and post the results (I hope it changes again this time).

Ok, I had three monitors… unplugged each of the 2 external ones and used the command… no change in ID’s. So the display ID’s do not change because of the unplugging:

2 monitors, 1st unplugged, 2nd unplugged (1st plugged again), all again:

irb(main):022:0* TotalSpaces2.display_list
=> [{:display_id=>69732482, :display_name=>“Color LCD”, :width=>1920, :height=>1200}, {:display_id=>188840115, :display_name=>“SyncMaster”, :width=>1920, :height=>1080}, {:display_id=>188765692, :display_name=>“SyncMaster”, :width=>1280, :height=>1024}]
irb(main):023:0> TotalSpaces2.display_list
=> [{:display_id=>69732482, :display_name=>“Color LCD”, :width=>1920, :height=>1200}, {:display_id=>188765692, :display_name=>“SyncMaster”, :width=>1280, :height=>1024}]
irb(main):024:0> TotalSpaces2.display_list
=> [{:display_id=>69732482, :display_name=>“Color LCD”, :width=>1920, :height=>1200}, {:display_id=>188840115, :display_name=>“SyncMaster”, :width=>1920, :height=>1080}]
irb(main):025:0> TotalSpaces2.display_list
=> [{:display_id=>69732482, :display_name=>“Color LCD”, :width=>1920, :height=>1200}, {:display_id=>188840115, :display_name=>“SyncMaster”, :width=>1920, :height=>1080}, {:display_id=>188765692, :display_name=>“SyncMaster”, :width=>1280, :height=>1024}]

Can I test anything else for you?

Thank you. I’ll get back to you shortly.

Any news on this? :smile:

I had intended to write a script that attempted to restore the spaces after such an event to prove that it works on your machine.

However, events have overtaken me a little, apologies, I will try to finish the script within the next few days.

I have written some scripts.

They ought to be packaged as a useful app with a sensible UI, but in the mean time you can by all means try them to see if they are helpful.

You’ll need TotalSpaces2 v2.1.6 and totalspaces2 gem v2.0.2 (use ‘gem update totalspaces2’)

There are two scripts here

One records which spaces are assigned to which screen, and the other moves the spaces to the correct screens.

eg.

ruby record_spaces_config.rb MyNormalSetup

and later…

ruby restore_spaces_config.rb MyNormalSetup

If you are comfortable running these scripts then I’d be interested to know if they work for you.

You could record several different setups (with different names) if you need.

They don’t create or destroy spaces - they just put existing spaces on the right displays.

Wow, now that I’m looking, this whole multi-display handling is a big problem. Wonder why it took all of us this long to become fed up with Apple’s bad logic in Mission Control!!!

Stephen, now anxiously awaiting your ability to get these scripts into normal TotalSpaces2…

What happens to the spaces when multi goes to single…?

I am more than half way through writing a small app that will manage your space configs, via the TotalSpaces2 API.

The idea is that you record a config that will remember whist display each of your spaces was on. Then you can restore such setups.

When you remove displays all except one space from each display will go back to your laptop screen.

I have made a small app that can move spaces between monitors - it can save and restore a configuration.

Maybe it will be helpful - please let me know if it works for you.

http://downloads.binaryage.com/DisplaySpacesManager-1.0.2.zip

The app is open source, you can fork it here (pull requests accepted!)

I gave this a try, but it did not work for what I was looking. Not sure what problem it’s supposed to solve.

I save one config with 2 displays with 9 spaces each as “Office.” Normally when I disconnect that external monitor, I get 17 spaces on the laptop alone. So I did that and deleted the extra rows to get back to 9 spaces for the MacBook alone and called this “MacBook.”

When I reconnect the external monitor and use the Restore button on your new app, it complains about missing Spaces (Space #### does not exist). Of course, because I deleted them and expected that DisplayManager would re-create them as needed!!!

When I hit Restore button for the MacBook config, it starts moving about 2 spaces at a time to the other display (when both are connected). Then I can hit Restore on the Office config line and it starts sending them back. So this program is really working to move spaces between displays, not to solve the issue of this thread where all spaces are being retained when removing external monitors…

Just some feedback for your efforts… Thanks for trying to solve this problem Apple created.

Ok, thanks for the feedback. So I’ll add the ability to delete and add spaces according to the saved setting.

Is it important to you to save app assignments, the name of the space and desktop backgrounds for the spaces that will be deleted and recreated?

By the way, to answer your first question - the problem it was meant to solve was jrobijns’s issue that the existing spaces didn’t migrate correctly to the correct monitors when they are plugged in.

I really can’t wait for Totalspaces to be able to do this in the GUI. That would make it ideal for me.

@jrobijns Before that, did you test the app I made - did it help your circumstance?

Hi Stephen,

Sorry didn’t have time to reply earlier (got involved in hot project not involving my main MacBook!)… But yes, I would say that it’s important to save all three of meta data with the Spaces.

I just had a reboot of this MacBook which completely forgot all those things. I’m not sure when those get stored for my current config and if it’s done by you or Mission Control. But this MacBook was unused for a few days, ran out of battery, and wouldn’t come out of hibernate by itself. Had to Force Shutdown and Restart with power button… got back to my desktop backgrounds from a month ago, no memory that I’d assigned Finder to be always in Space 5, and no names. I like change but I also get used to certain backgrounds to cue what activity I’m in on that Space.

If you do build it into TotalSpaces Preference dialog to save current config, it would be a nice place to explicitly store current settings of everything about my current setup with Displays, Spaces, App Assignments, Names, and Backgrounds. I’m surprised you haven’t been able to replicate these issues… I just got another MacBook (mostly using it in BootCamp currently). I’ll install TotalSpaces there too and test how that behaves with all these Display changes etc.

I’m still having issues like this constantly with my Macbook. I have 2 external displays, if I happen to use the Macbook without those displays connected, when I go back to using them everything gets moved around!

Oddly, my middle monitor always stays correct. The Macbook itself and my other monitor lose displays, they get shifted around, etc.

It’s really limiting my usefulness of the utility.