Merge pull request #200288 from kyu08/cursor-link
[Homebrew/homebrew-cask.git] / Casks / k / karabiner-elements.rb
blobd7177ec434b65ebd485e921296e07a2fe9e0d499
1 cask "karabiner-elements" do
2   on_mojave :or_older do
3     on_el_capitan :or_older do
4       version "11.6.0"
5       sha256 "c1b06252ecc42cdd8051eb3d606050ee47b04532629293245ffdfa01bbc2430d"
6     end
7     on_sierra :or_newer do
8       version "12.10.0"
9       sha256 "53252f7d07e44f04972afea2a16ac595552c28715aa65ff4a481a1c18c8be2f4"
10     end
12     livecheck do
13       skip "Legacy version"
14     end
16     pkg "Karabiner-Elements.sparkle_guided.pkg"
18     uninstall launchctl: [
19                 "org.pqrs.karabiner.agent.karabiner_grabber",
20                 "org.pqrs.karabiner.agent.karabiner_observer",
21                 "org.pqrs.karabiner.karabiner_console_user_server",
22                 "org.pqrs.karabiner.karabiner_kextd",
23                 "org.pqrs.karabiner.karabiner_session_monitor",
24               ],
25               signal:    [
26                 ["TERM", "org.pqrs.Karabiner-Menu"],
27                 ["TERM", "org.pqrs.Karabiner-NotificationWindow"],
28               ],
29               script:    {
30                 executable: "/Library/Application Support/org.pqrs/Karabiner-Elements/uninstall_core.sh",
31                 sudo:       true,
32               },
33               pkgutil:   "org.pqrs.Karabiner-Elements",
34               delete:    "/Library/Application Support/org.pqrs/"
35   end
36   on_catalina :or_newer do
37     on_catalina do
38       version "13.7.0"
39       sha256 "9ac5e53a71f3a00d7bdb2f5f5f001f70b6b8b7b2680e10a929e0e4c488c8734b"
41       livecheck do
42         skip "Legacy version"
43       end
44     end
45     on_big_sur do
46       version "14.13.0"
47       sha256 "826270a21b7f4df9b9a8c79c9aad4de8f48021f58eaacbee1d4f150c963c6cbc"
49       livecheck do
50         skip "Legacy version"
51       end
52     end
53     on_monterey do
54       version "14.13.0"
55       sha256 "826270a21b7f4df9b9a8c79c9aad4de8f48021f58eaacbee1d4f150c963c6cbc"
57       livecheck do
58         skip "Legacy version"
59       end
60     end
61     on_ventura :or_newer do
62       version "15.3.0"
63       sha256 "4b37f69810bc738240dcacb840f4ef4b8189d0f5c56cdd18ed1a6e9bd9510011"
65       livecheck do
66         url "https://appcast.pqrs.org/karabiner-elements-appcast.xml"
67         strategy :sparkle
68       end
69     end
71     pkg "Karabiner-Elements.pkg"
73     uninstall early_script: {
74                 executable: "/Library/Application Support/org.pqrs/Karabiner-DriverKit-VirtualHIDDevice/scripts/uninstall/remove_files.sh",
75                 sudo:       true,
76               },
77               launchctl:    [
78                 "org.pqrs.karabiner.agent.karabiner_grabber",
79                 "org.pqrs.karabiner.agent.karabiner_observer",
80                 "org.pqrs.karabiner.karabiner_console_user_server",
81                 "org.pqrs.karabiner.karabiner_grabber",
82                 "org.pqrs.karabiner.karabiner_observer",
83                 "org.pqrs.karabiner.karabiner_session_monitor",
84                 "org.pqrs.karabiner.NotificationWindow",
85               ],
86               signal:       [
87                 ["TERM", "org.pqrs.Karabiner-Menu"],
88                 ["TERM", "org.pqrs.Karabiner-NotificationWindow"],
89               ],
90               script:       {
91                 executable: "/Library/Application Support/org.pqrs/Karabiner-Elements/uninstall_core.sh",
92                 sudo:       true,
93               },
94               pkgutil:      [
95                 "org.pqrs.Karabiner-DriverKit-VirtualHIDDevice",
96                 "org.pqrs.Karabiner-Elements",
97               ],
98               delete:       "/Library/Application Support/org.pqrs/"
99     # The system extension 'org.pqrs.Karabiner-DriverKit-VirtualHIDDevice*' should not be uninstalled by Cask
100   end
102   url "https://github.com/pqrs-org/Karabiner-Elements/releases/download/v#{version}/Karabiner-Elements-#{version}.dmg",
103       verified: "github.com/pqrs-org/Karabiner-Elements/"
104   name "Karabiner Elements"
105   desc "Keyboard customiser"
106   homepage "https://karabiner-elements.pqrs.org/"
108   auto_updates true
110   binary "/Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli"
112   zap trash: [
113     "~/.config/karabiner",
114     "~/.local/share/karabiner",
115     "~/Library/Application Scripts/org.pqrs.Karabiner-VirtualHIDDevice-Manager",
116     "~/Library/Application Support/Karabiner-Elements",
117     "~/Library/Caches/org.pqrs.Karabiner-Elements.Updater",
118     "~/Library/Containers/org.pqrs.Karabiner-VirtualHIDDevice-Manager",
119     "~/Library/HTTPStorages/org.pqrs.Karabiner-Elements.Settings",
120     "~/Library/Preferences/org.pqrs.Karabiner-Elements.Updater.plist",
121   ]