Amalgam

http://f.hatena.ne.jp/images/fotolife/c/cho45/20071027/20071027185143.png

This is a launcher.

Features

  • Fuzzy search.
  • Stabler than QuickSilver? at least.
  • Extendable.
  • (almost) fast.

http://f.hatena.ne.jp/images/fotolife/c/cho45/20071027/20071027191421.png

Amalgam is built on RubyCocoa? so all configurations can be written in Ruby.

Release/Download

Super Alpha (version 0):

http://lab.lowreal.net/test/amalgam/

This package includes RubyCocoa? and the others dependencies, so will work as standalone.

Latest announces:

Built-in Commands

.d command is eval command in internal context.

.d restart
Restart Amalgam.
.d build_candidates
Rebuild candidates. Plugins are also run.

Configurations

All configurations are located under ~/.amalgam directory.

config.yaml

This file is now only for config hotkey.

--
:hotkey: Command+Control+O

initrc.rb

~/.amalgam/initrc.rb is only evaluated once at launch time.

# additional hotkey
NSApp.register_hotkey("Command+Control+C") do
        color = `/Users/cho45/coderepos/lang/objective-c/misc/cpmousecolor`
        alert("Copied", color)
end

log :Loaded

alert method is shortcut for NSRunAlert. First argument is title, second is message body.

plugins

~/.amalgam/plugins/*.rb is all plugin file, this is evaluated at building candidates context.

test.rb (filename is important. test.rb must include Test class. Also foo_bar.rb must include FooBar? class)

# must inherit AmalgamPlugin class.
class Test < AmalgamPlugin

        # if ommited, use default fuzzy method
        def filter(candidates, str)
                log candidates
                candidates.sort_by {|i| i.name }
        end

        def candidates
                if amalgam.sublaunchers.empty?
                        [
                                Candidate.new("TEST", "TEST", :txt) do
                                        amalgam.sublaunchers << self
                                        amalgam.clear
                                end
                        ]
                else
                        [
                                Candidate.new("Dummy1", "Dummy", :txt) do
                                        log :dummy
                                end,
                                Candidate.new("Dummy2", "Dummy", :txt) do
                                        log :dummy
                                end,
                                Candidate.new("Dummy3", "Dummy", :txt) do
                                        log :dummy
                                end,
                        ]
                end
        end
end
Candidate.new("Name of App.", description, icon, &block)

icon.class Symbol   -> File type
           Pathname -> Full path for file
           NSImage  -> Use it
           NSData   -> Source of NSImage
           String   -> Source of NSImage
Command.new(name, description, icon, &block)