-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsketchybar.rb
85 lines (78 loc) · 2.68 KB
/
sketchybar.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
class Sketchybar < Formula
env :std
desc "Custom macOS statusbar with shell plugin, interaction and graph support"
homepage "https://github.com/FelixKratz/SketchyBar"
url "https://github.com/FelixKratz/SketchyBar/archive/refs/tags/v2.5.0.tar.gz"
sha256 "298a3c825224fce5cc5af888cbc6a55e2b36fb150d1b0073a9ff496d836e365d"
license "GPL-3.0-only"
head "https://github.com/FelixKratz/SketchyBar.git"
depends_on "cmake"
def clear_env
ENV.delete("CFLAGS")
ENV.delete("LDFLAGS")
ENV.delete("CXXFLAGS")
end
def install
clear_env
(var/"log/sketchybar").mkpath
if build.head?
system "make"
else
system "cmake", "."
system "make"
end
system "codesign", "--force", "-s", "-", "#{buildpath}/bin/sketchybar"
bin.install "#{buildpath}/bin/sketchybar"
(pkgshare/"examples").install "#{buildpath}/sketchybarrc"
(pkgshare/"examples").install "#{buildpath}/plugins/"
end
def caveats
<<~EOS
Copy the example configuration into your home directory and make the scripts executable:
mkdir ~/.config/sketchybar
cp #{opt_pkgshare}/examples/sketchybarrc ~/.config/sketchybar/sketchybarrc
mkdir ~/.config/sketchybar/plugins
cp -r #{opt_pkgshare}/examples/plugins/ ~/.config/sketchybar/plugins/
chmod +x ~/.config/sketchybar/plugins/*
EOS
end
plist_options manual: "sketchybar"
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>#{opt_bin}/sketchybar</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>#{HOMEBREW_PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>LANG</key>
<string>en_US.UTF-8</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>#{var}/log/sketchybar/sketchybar.out.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/sketchybar/sketchybar.err.log</string>
<key>ProcessType</key>
<string>Interactive</string>
<key>Nice</key>
<integer>-20</integer>
</dict>
</plist>
EOS
end
test do
echo "To test your installation run: sketchybar -v \n"
end
end