Version 2.1+ of TotalSpaces2 is available by ticking the “Include pre-releases” checkbox in General Preferences and then selecting “Check for updates” from the menu.
This gem enables you to get information from and to control TotalSpaces2
It is the officially supported way of using the API library libtotalspaces2api, and the required dylib comes bundled with this gem. This gem uses Ruby-FFI to call the functions in the dylib. You'll need a sane ruby and compilation environment to install ruby-ffi - it probably won't install immediately with the ruby that comes with Mavericks because none of the compilation tools are present. We use homebrew and rbenv to manage our ruby scripting environment.
You may use this gem in various ways. For instance, you could:
Display a message or alert when a particular space is moved to
Automatically change the name of spaces depending on what apps are in them
Record which spaces certain windows are on, and restoring those windows to those spaces when the owning app restarts
Trigger moving certain windows between spaces
API support, and support for this gem starts with TotalSpaces2 v2.1 The API is a premium feature, and will only work with registered versions of TotalSpaces2.
The latest version of the TotalSpaces2 gem can be installed with RubyGems:
% [sudo] gem install totalspaces2
Source code can be downloaded on GitHub
require 'totalspaces2' TotalSpaces2.on_space_change {|from, to, display_id| puts "Moving from space #{from} to space #{to}";} TotalSpaces2.move_to_space(1) current_space = TotalSpaces2.current_space puts "Current space number: #{current_space}" puts "Current space is called: #{TotalSpaces2.name_for_space(current_space)}" TotalSpaces2.set_name_for_space(1, "Home")
The TotalSpaces2 gem is released under the MIT license:
The source code of the dylib is not available at this time.