-
Notifications
You must be signed in to change notification settings - Fork 4
/
goku.rb
46 lines (42 loc) · 1.53 KB
/
goku.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Documentation: https://docs.brew.sh/Formula-Cookbook
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
class Goku < Formula
depends_on "watchexec"
depends_on "candid82/brew/joker"
# depends_on "https://raw.githubusercontent.com/candid82/homebrew-brew/2491ed79f9733e6d58b41eef0a771659a0eed162/joker.rb"
desc "karabiner configurator"
homepage "https://github.com/yqrashawn/GokuRakuJoudo"
url "https://github.com/yqrashawn/GokuRakuJoudo/releases/download/v0.5.3/goku.zip"
sha256 "120f633e04de17ab6d5dfd053d1c282d8af31e72483080eeb3e4cf00c89f73cd"
def install
bin.install "goku"
bin.install "gokuw"
end
plist_options :manual => "gokuw"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-c</string>
<string>exec -a gokuw #{Formula["watchexec"].opt_bin}/watchexec --restart -e edn --watch #{ENV["HOME"]}/.config/karabiner.edn #{opt_bin}/goku</string>
</array>
<key>StandardErrorPath</key>
<string>#{ENV["HOME"]}/Library/Logs/goku.log</string>
<key>StandardOutPath</key>
<string>#{ENV["HOME"]}/Library/Logs/goku.log</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
system "#{bin}/goku", "--help"
end
end