{"action":"created","issue":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/14854","labels_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/14854/labels{/name}","comments_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/14854/comments","events_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/14854/events","html_url":"https://github.com/caskroom/homebrew-cask/issues/14854","id":114461080,"number":14854,"title":"add support for Login Items removal during uninstallation","user":{"login":"forkbomber","id":2144010,"avatar_url":"https://avatars.githubusercontent.com/u/2144010?v=3","gravatar_id":"","url":"https://api.github.com/users/forkbomber","html_url":"https://github.com/forkbomber","followers_url":"https://api.github.com/users/forkbomber/followers","following_url":"https://api.github.com/users/forkbomber/following{/other_user}","gists_url":"https://api.github.com/users/forkbomber/gists{/gist_id}","starred_url":"https://api.github.com/users/forkbomber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forkbomber/subscriptions","organizations_url":"https://api.github.com/users/forkbomber/orgs","repos_url":"https://api.github.com/users/forkbomber/repos","events_url":"https://api.github.com/users/forkbomber/events{/privacy}","received_events_url":"https://api.github.com/users/forkbomber/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/core","name":"core","color":"b10dc9"},{"url":"https://api.github.com/repos/caskroom/homebrew-cask/labels/enhancement","name":"enhancement","color":"0074d9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-01T09:41:43Z","updated_at":"2015-11-01T12:32:57Z","closed_at":null,"body":"Majority of GUI clients persist their autostart preference inside users Login Items list.\r\nA few examples of such applications are [dropbox.rb](../blob/master/Casks/dropbox.rb), [spotify.rb](../blob/master/Casks/spotify.rb) and [flux.rb](../blob/master/Casks/flux.rb).\r\n\r\nConfiguration files are located at `~/Library/Preferences/com.apple.loginitems.plist` and items can be removed from there.\r\nA nicer option would be to use `osascript`:\r\n`osascript -e 'tell application \"System Events\" to delete every login item whose name is \"AppName\"'`\r\nThis not only removes every matching Login Item, but also it would continue normally if there aren't any matches.\r\n\r\nI'd like to see a helper dedicated to deal with Login Items within HBC so that \r\n```ruby\r\nuninstall_postflight do\r\n  system '/usr/bin/osascript', '-e', %Q{tell application \"System Events\" to delete every \\\r\n    login item whose name is \"#{token.gsub(/\\w+/, &:capitalize).gsub('-', ' ')}\"}\r\nend\r\n```\r\ncan be replaced with something like\r\n```ruby\r\nuninstall :login_item => 'Turbo Boost Switcher'\r\n```"},"comment":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/comments/152822789","html_url":"https://github.com/caskroom/homebrew-cask/issues/14854#issuecomment-152822789","issue_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/14854","id":152822789,"user":{"login":"vitorgalvao","id":1699443,"avatar_url":"https://avatars.githubusercontent.com/u/1699443?v=3","gravatar_id":"","url":"https://api.github.com/users/vitorgalvao","html_url":"https://github.com/vitorgalvao","followers_url":"https://api.github.com/users/vitorgalvao/followers","following_url":"https://api.github.com/users/vitorgalvao/following{/other_user}","gists_url":"https://api.github.com/users/vitorgalvao/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorgalvao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorgalvao/subscriptions","organizations_url":"https://api.github.com/users/vitorgalvao/orgs","repos_url":"https://api.github.com/users/vitorgalvao/repos","events_url":"https://api.github.com/users/vitorgalvao/events{/privacy}","received_events_url":"https://api.github.com/users/vitorgalvao/received_events","type":"User","site_admin":false},"created_at":"2015-11-01T12:32:57Z","updated_at":"2015-11-01T12:32:57Z","body":"The idea is great, but we should change it to use the apps’s bundle ID instead. Could we change `login item whose name is` to `login item whose id is` directly, or do we need something more?"}}