RubyGems Navigation menu

geoffrey 0.0.1

geoffrey ======== ## ALERT! This is very early alpha code, use with precaution. It's a spinoff of myself willing to improve my [dotfiles project](http://github.com/albertllop/dotfiles) a step further. All code examples in this README come from it. ## Introduction Geoffrey's your little helper, that who just wants to makes your life easier. It aims to help you create little scripts to setup your OSX the way you like. If, like me, you use different computers at work, home, or even when travelling, you'll know it's a pain in the ass to keep everything up to date. Inspired in the numerous dotfiles projects, specially [holman's](http://github.com/holman/dotfiles), the intention is to bring customization to a bigger extend. ## Installation $ [sudo] gem install geoffrey Geoffrey's Talents ================== Geoffrey has many talents, and thus you'll find he can help you in one of these areas: ## Packages If you ever used [Ciarán Walsh's](http://ciaranwal.sh) SIMBL plugins, you'll remember what a pain it is to install them every time. Now you can do so with the next piece of code: require 'geoffrey' Geoffrey.package do url 'http://www.culater.net/dl/files/SIMBL-0.9.7a.zip' options :sudo => true, :unless => Proc.new{ File.exists?("/Library/LaunchAgents/net.culater.SIMBL.Agent.plist") } end Geoffrey will take care of downloading the zip file, and install whatever .pkg file is in the zip. The possible options are: * `:sudo` => in case it needs to be executed as sudo to install (it does if the installer would ever ask for your password) * `:unless` => in order to make running this idempotent. * `:file` => specify which of the files contained in the zip has to be installed. If it's not specified it uses the first .pkg it finds. With that you'll have SIMBL installed and working. Now suppose you want to install a bundle. You'd have to download a file, and move it to a directory. Geoffrey can help you a little, basically downloading and uncompressing the zip, and you just have to define the install method. require 'geoffrey' Geoffrey.package do url "http://github.com/dabeeeenster/terminaltabswitching/raw/master/TerminalTabSwitching.bundle.zip" options :file => "TerminalTabSwitching.bundle" def install plugins_dir = "#{ENV["HOME"]}/Library/Application Support/SIMBL/Plugins" FileUtils.mkdir_p plugins_dir FileUtils.mv file_to_install, plugins_dir, :force => true end end `file_to_install` is provided by geoffrey poiting to the automatically downloaded/uncompressed file. ## Application Configuration Everything in OSX seems to work around `.plist` files. This takes a little bit of work to figure out, but once you do, you can have your favourite apps the way you like. This is my script to get Terminal.app up and running with Pro scheme, Menlo Font 14pt, and a size 520x100. require 'geoffrey' Geoffrey.plist do file :terminal affects "/Applications/Utilities/Terminal.app" options["Default Window Settings"] = "Pro" options["Startup Window Settings"] = "Pro" options["HasMigratedDefaults"] = true options["Window Settings"]["Pro"]["Font"] = "bplist00\xD4\x01\x02\x03\x04\x05\x06\x18\x19X$versionX$objectsY$archiverT$top\x12\x00\x01\x86\xA0\xA4\a\b\x11\x12U$null\xD4\t\n\v\f\r\x0E\x0F\x10V$classVNSNameVNSSizeXNSfFlags\x80\x03\x80\x02\#@,\x00\x00\x00\x00\x00\x00\x10\x10]Menlo-Regular\xD2\x13\x14\x15\x16Z$classnameX$classesVNSFont\xA2\x15\x17XNSObject_\x10\x0FNSKeyedArchiver\xD1\x1A\eTroot\x80\x01\b\x11\x1A#-27 Geoffrey knows of a few files in your system you can specify with symbols. If you want to work with a different one, just write the full path. * `affects` => When you close Terminal.app, it'll dump its otions into the plist. So you have to stop it, change the plist file, then reopen it. Geoffrey does this automatically if you tell him what must be rebooted. * `options` => Its the plist has per se. Using the fantastic [plist4r](http://github.com/dreamcat4/plist4r) gem, you can modify it. You might have seen something peculiar: options["Window Settings"]["Pro"]["Font"].blob = true Some values in plist files are of type "Data", which is just binary stuff. Plist4r handles these as strings with a special flag. The best way to know what to put in every value, is to just go to the file and take a look. They all tend to make sense. For data values, however, you might have more work. The way I do it is opening the file with Plist4r, and reading the value: require 'plist4r' plist = Plist4r.open("the/file.plist") plist["whatever"]["option"] # => copy whatever it returns Just make sure that when you set it in your geoffrey you put the flag blog true. Otherwise you might see some really weird system errors. ## A few words This is work done in my free hours, it's not yet finished. The code is dirty and mainly undocumented. It all started on #whyday, but I'm so lazy that I've needed a lot of time to do just this. Thanks!

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 1.1.3 - September 19, 2010 (21 KB)
  2. 0.1.3 - September 19, 2010 (21 KB)
  3. 0.1.2 - September 19, 2010 (21 KB)
  4. 0.1.1 - September 14, 2010 (20.5 KB)
  5. 0.1.0 - September 10, 2010 (18.5 KB)
  6. 0.0.1 - August 28, 2010 (15 KB)
Show all versions (11 total)

Runtime Dependencies (1):

plist4r >= 0

Development Dependencies (3):

bundler ~> 1.0.0.rc.5
mocha ~> 0.9.8
rspec ~> 1.3.0

Owners:

Authors:

  • Albert Llop

SHA 256 checksum:

d138c82926600ba1b4f4584216fb824eb6a75d9865a68094e6f7641e6bc095e6

Total downloads 42,679

For this version 3,747

Licenses:

N/A

Required Ruby Version: None

Required Rubygems Version: >= 1.3.6

Links: