{"id":343,"date":"2011-06-03T12:41:00","date_gmt":"2011-06-03T17:41:00","guid":{"rendered":"http:\/\/www.brunerd.com\/blog\/?p=343"},"modified":"2012-04-12T16:09:43","modified_gmt":"2012-04-12T21:09:43","slug":"safe-downloads-widget","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2011\/06\/03\/safe-downloads-widget\/","title":{"rendered":"Safe Downloads List Info Widget"},"content":{"rendered":"<p>UPDATE: The AUTOUPDATE code only works as root and so is not useful in the Dashboard environment! This has been removed from the widget.<\/p>\n<p>So I slapped together a widget for the Safe Downloads commands I post at <a href=\"http:\/\/hints.macworld.com\/article.php?story=20110602091032338\">OSXHints<\/a>:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-381\" title=\"Safe Downloads Info\" src=\"http:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Safe-Downloads-Info.png\" alt=\"\" width=\"346\" height=\"120\" srcset=\"https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Safe-Downloads-Info.png 346w, https:\/\/www.brunerd.com\/blog\/wp-content\/uploads\/Safe-Downloads-Info-300x104.png 300w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.brunerd.com\/software\/Safe-Downloads-Info.zip\">Safe Downloads Info Widget<\/a><\/p>\n<p>Nothing glamorous just the facts and the following code is how it gets it&#8217;s values:<\/p>\n<p><code>defaults read \/System\/Library\/CoreServices\/CoreTypes.bundle\/Contents\/Resources\/XProtect.meta LastModification<br \/>\ndefaults read \/System\/Library\/CoreServices\/CoreTypes.bundle\/Contents\/Resources\/XProtect.meta Version<\/code><\/p>\n<p>The auto updates status took a bit more massaging:<\/p>\n<p><code>eval $(sudo defaults read \/private\/var\/db\/launchd.db\/com.apple.launchd\/overrides com.apple.xprotectupdater | sed 's\/ \/\/g')<br \/>\nif [ ${Disabled:=0} -eq 0 ]; then<br \/>\necho ON<br \/>\nelse<br \/>\necho OFF<br \/>\nfi<\/code><\/p>\n<p>All apologies to Dashboard coding perfectionists but the calls for the widget are synchronous, and reading up on Dashboard coding best practices, Apple says a shipping widget should only use asynchronous calls for info&#8230; oh well it works well enough for me! :) Perhaps I&#8217;ll go back and throw in extra lines of code for asynchronous handlers when I can, if my widget freezes up any other widgets you can simply restart Dashboard by killing to Dock process from Activity Monitor.<\/p>\n<p>Related:<br \/>\n<a title=\"myXProtectStatus\" href=\"http:\/\/www.brunerd.com\/blog\/2011\/06\/16\/myxprotectstatus\/\">myXprotect Status<\/a> &#8211; a\u00a0drop down list of threats protected against for the menu bar<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE: The AUTOUPDATE code only works as root and so is not useful in the Dashboard environment! This has been removed from the widget. So I slapped together a widget for the Safe Downloads commands I post at OSXHints: Safe Downloads Info Widget Nothing glamorous just the facts and the following code is how it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,12,8],"tags":[],"class_list":["post-343","post","type-post","status-publish","format-standard","hentry","category-apple","category-os-x","category-scripting","category-security"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=343"}],"version-history":[{"count":8,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/343\/revisions"}],"predecessor-version":[{"id":346,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/343\/revisions\/346"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}