-- -- Author : Dennis Eriksen -- File : appkiller.lua -- Created : 2024-12-03 -- if (config.killApps == nil or config.killApps == 0) then print("no appkiller") return end local applicationWatcher = function(appName, eventType, appObject) if (eventType == hs.application.watcher.launching) then if (require("utils").hasValue(config.killApps, appName)) then local _, _, _, ec = hs.execute([["/usr/bin/killall" ]] .. appName) hs.alert.show((ec == 0 and "Killed " or "An error occurred terminating ") .. appName) end end end local appWatcher = hs.application.watcher.new(applicationWatcher) appWatcher:start()