aboutsummaryrefslogtreecommitdiffstats
path: root/HomebrewFormula/dome-key.rb
diff options
context:
space:
mode:
authorTeddy Wing2019-06-01 16:25:11 +0200
committerTeddy Wing2019-06-01 16:25:11 +0200
commit9b87a2600ff5263b6c3a22affdc5b02f3e7fb102 (patch)
treef460e82ccfd5033b96e0668ff0e7d700b0289029 /HomebrewFormula/dome-key.rb
downloadhomebrew-formulae-9b87a2600ff5263b6c3a22affdc5b02f3e7fb102.tar.bz2
Add formulae from existing projects
Copy over all Homebrew formulae that I've been putting in project repositories. Now that I have a few formulae, grouping them together in a tap makes it more easy to install and upgrade them. No need to tap multiple repositories or use the full URL to a formula.
Diffstat (limited to 'HomebrewFormula/dome-key.rb')
-rw-r--r--HomebrewFormula/dome-key.rb67
1 files changed, 67 insertions, 0 deletions
diff --git a/HomebrewFormula/dome-key.rb b/HomebrewFormula/dome-key.rb
new file mode 100644
index 0000000..42e3e7c
--- /dev/null
+++ b/HomebrewFormula/dome-key.rb
@@ -0,0 +1,67 @@
+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 "03fd038e1ae67ce1fce949d2d5fcafb50bbee2f4344b71c16577929c557718a1"
+
+ # 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
+
+ If `dome-key` is already running, load the new mappings:
+
+ dome-key --reload-mappings
+ 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