diff options
| author | Teddy Wing | 2018-11-22 21:38:22 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-11-22 21:38:22 +0100 |
| commit | f1ac9d62c118be4f452c073612dd044468942477 (patch) | |
| tree | 521d4cd7b451686de071ad3e7b940f813e18db35 | |
| download | homebrew-DomeKey-f1ac9d62c118be4f452c073612dd044468942477.tar.bz2 | |
Add dome-key.rb formula v1.0
| -rw-r--r-- | HomebrewFormula/dome-key.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/HomebrewFormula/dome-key.rb b/HomebrewFormula/dome-key.rb new file mode 100644 index 0000000..2473ce7 --- /dev/null +++ b/HomebrewFormula/dome-key.rb @@ -0,0 +1,63 @@ +class DomeKey < Formula + desc "Control your computer with a pair of headphones" + homepage "https://domekey.teddywing.com" + version "1.0" + url "https://domekey.teddywing.com/downloads/dome-key_1.0.tar.bz2" + sha256 "999377af51f9bfd381dcc5cce1a4ece0626774a35674827ad5002e5a2c2786f4" + + # Rust code requires at least 10.7 + depends_on :macos => :lion + + def install + bin.install "dome-key" + man1.install "dome-key.1" + man7.install "dome-key-mappings.7" + end + + def plist_name + "com.teddywing.dome-key" + end + + def caveats; <<~EOS + To get started with a set of mappings, try running the these commands: + + mkdir -p $HOME/.config/dome-key + cat <<EOM > $HOME/.config/dome-key/mappings.dkmap + map <Play> <Nop> + + mode <Play><Play> { + map <Up> <Left> + map <Play> <Space> + map <Down> <Right> + } + EOM + EOS + end + + plist_options :manual => "dome-key --daemon --audio" + + def plist; <<~EOS + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> + <dict> + <key>Label</key> + <string>com.teddywing.dome-key</string> + <key>ProgramArguments</key> + <array> + <string>/usr/local/bin/dome-key</string> + <string>--daemon</string> + <string>--audio</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>KeepAlive</key> + <true/> + <key>StandardErrorPath</key> + <string>/tmp/dome-key.log</string> + </dict> + </plist> + EOS + end +end |
