From 1bfafeae419874f7ea8cd630ef7727fd95ac60b0 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 16 Dec 2023 13:31:47 -0500 Subject: [PATCH] proxy-audio-device: install audio driver Fixes https://github.com/briankendall/proxy-audio-device/issues/13 This change does a few things to fix the installation of proxy-audio-device, based on the README for installation: https://github.com/briankendall/proxy-audio-device#manual-installation - Install the audio driver to `/Libary/Audio/Plug-Ins/HAL` - Kickstart `coreaudiod` on install and uninstall for the device to be available - zap saved application state for the settings app --- Casks/p/proxy-audio-device.rb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Casks/p/proxy-audio-device.rb b/Casks/p/proxy-audio-device.rb index 94dfe506b4..33965811c0 100644 --- a/Casks/p/proxy-audio-device.rb +++ b/Casks/p/proxy-audio-device.rb @@ -8,6 +8,33 @@ cask "proxy-audio-device" do homepage "https://github.com/briankendall/proxy-audio-device" app "Proxy Audio Device Settings.app" + artifact "ProxyAudioDevice.driver", target: "/Library/Audio/Plug-Ins/HAL/ProxyAudioDevice.driver" - # No zap stanza required + postflight do + set_ownership "/Library/Audio/Plug-Ins/HAL/ProxyAudioDevice.driver", + user: "root", + group: "wheel" + + system_command "/bin/launchctl", + args: [ + "kickstart", + "-k", + "system/com.apple.audio.coreaudiod", + ], + sudo: true, + must_succeed: true + end + + uninstall_postflight do + system_command "/bin/launchctl", + args: [ + "kickstart", + "-k", + "system/com.apple.audio.coreaudiod", + ], + sudo: true, + must_succeed: true + end + + zap trash: "~/Library/Saved Application State/net.briankendall.Proxy-Audio-Device-Settings.savedState" end