From ec659cf998fbf75f572a7ac4ac11a06a443b82d9 Mon Sep 17 00:00:00 2001 From: liam Date: Fri, 26 Jun 2015 09:22:14 +0800 Subject: [PATCH] Add new hidden files plugin which can toggle hidden files setting and its command is shorter. --- PluginDirectories/1/hidden.bundle/Icon.png | Bin 0 -> 9526 bytes .../1/hidden.bundle/examples.txt | 2 ++ PluginDirectories/1/hidden.bundle/info.json | 8 ++++++++ PluginDirectories/1/hidden.bundle/plugin.py | 19 ++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 PluginDirectories/1/hidden.bundle/Icon.png create mode 100644 PluginDirectories/1/hidden.bundle/examples.txt create mode 100644 PluginDirectories/1/hidden.bundle/info.json create mode 100644 PluginDirectories/1/hidden.bundle/plugin.py diff --git a/PluginDirectories/1/hidden.bundle/Icon.png b/PluginDirectories/1/hidden.bundle/Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e2001271470e357e00553aac40590ffcb1da0f71 GIT binary patch literal 9526 zcmds7`9D-|^nYdy#y-lHtSJ;B`#zQ;A*B?uOC^Nt+ssfXM7xlsMLv}^lx>VP6|!Z? zHujw{#xlm3`<=e8*Y}_J&M(ir&OPgM?>W!C=Y1YtIB(9wDar`|;ITM++7i%yI#Qfy1$2)l!c%BO)pz7_v;aXKfUw;I67o;+W2z# z@XFZ9S7JZ2N1wI%~K4PpR&VW_gc`+12+of0oi{KMFfi!in=A&A)tq_c4`Dg^s8mQAIHQ`G5W! z4$0$iqo$^%nfEKdyN0D7WxNxImfDwsLYBMc($mv}ig@9mJKEUw$e*?(T? z_oC4)fI<=5GRQh_kLlVS#SZx(r6{cgDz*birh?k%gJUZ!#S zx~Bk;WY`3lZktV(Br{I?bgM}mlmbT0XV7bPJJ#z~xs&m+-vaea{@Gp@-oLms3mLw` zca?U2?)uh$^R~A%9E`eBm*1iXM6cfxYBmx?e8_~uz!@S6JxhK7U^tItj6pJ52vgFN zfBh7ws_lzWVnX!KGzU)@4g91PD*9YcCXDUxG8zOMaZW&)%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S;aqdPn{KU>%IP%Pub^_kbi|-5IJLi- z-gJYaWJ?}g76vJ7rMv&(z7{Oz6pYuq5CE&l!GW5a`bw)F=n zR?>JST9e1#hemEJEU!UIg?F20;VAceXy0)}*k2;qhK7GjfWCe!b_MbnbtzuUkuw31 zyW2}R?$D@Ljn$c3g$pF-=#IO^Oyj6RXZ9ox=k0Z2P$h?~<8%>%&&<-iTU_nBm8Gb z=s(h6)M9~wRvZZYAoCE9_W5@(&m!37AH^-2AO?mLifcF;K6bKO*$1zbfgvN^+?Z|V z*`A&r!WF`PZ4by}|J{7I3Szf*N8t7!v8BZI!;Q3VG_Ej3f8T4+9%7sPZ? z`2h-HG|3Lb&BYl-x8br`-&|uttS&K10vH6?7H5<7K0RUY(=hJzU4oFkhXMe{pE%w9j+AR?0q!S^#2285wR z;%D_^McB+7@58d%-b&UzXNLhzUKR;{74@x}{cj1(xbrepP^JxoO~62jMs%o81Yngl zHd4@7oGnjb@C^D@YZ?Ge%wYoNWCLV0aSCRwR>!2UaIs9kP*LeU;_Fs#yLmH{1qKoh zvzblKU2L>Z4oI|LC-Aku*{^0ghSO&;=4Np{Brfmh^j0`(hj@6{9N_MnvwuI1N@0!j z?ObLKOZ2y!1Au_DN+Q6-Z=-5gJztLi+`cQp?d(Ba=B8VaSUly1pRIer7&_ zYz%OtagEPjNCng#;9aswom0roz0^oJhmX9r6bC>d;(qA?0ZjGA&CgJsPl$BM|IL$d z>LY=XUhHJ?lY6ozO}7J~p=Vm^eE-j8G*u*XF Fe*kJD&$s{p literal 0 HcmV?d00001 diff --git a/PluginDirectories/1/hidden.bundle/examples.txt b/PluginDirectories/1/hidden.bundle/examples.txt new file mode 100644 index 00000000..01a976ea --- /dev/null +++ b/PluginDirectories/1/hidden.bundle/examples.txt @@ -0,0 +1,2 @@ +hide +hide ~message(yes) \ No newline at end of file diff --git a/PluginDirectories/1/hidden.bundle/info.json b/PluginDirectories/1/hidden.bundle/info.json new file mode 100644 index 00000000..9bf8d9d4 --- /dev/null +++ b/PluginDirectories/1/hidden.bundle/info.json @@ -0,0 +1,8 @@ +{ + "name" : "hidden", + "displayName" : "Toggle/show/hide hidden files", + "description" : "Quickly toggle/show/hide hidden files and folders in OS X", + "examples" : ["hide","hide yes","hide no"], + "categories" : ["Utilities"], + "creator_name": "Antonio Cruz", +} \ No newline at end of file diff --git a/PluginDirectories/1/hidden.bundle/plugin.py b/PluginDirectories/1/hidden.bundle/plugin.py new file mode 100644 index 00000000..cdd7f9e5 --- /dev/null +++ b/PluginDirectories/1/hidden.bundle/plugin.py @@ -0,0 +1,19 @@ +def results(fields, original_query): + if original_query == 'hide': + import os + isShowAllFiles = 'YES' == os.popen("defaults read com.apple.finder AppleShowAllFiles").read().strip() + showAllFiles = not isShowAllFiles + else: + showAllFiles = fields['~message'] != 'yes' + return { + "title": "Show hidden files" if showAllFiles else "Hide hidden files", + "run_args": ["YES" if showAllFiles else "NO"] + #"html": "

{0}

".format(message) + } + +def run(showAllFiles): + import os + cmd = showAllFiles + os.system("osascript -e 'do shell script \"defaults write com.apple.finder AppleShowAllFiles " + cmd + "\"'") + os.system("osascript -e 'tell app \"Finder\" to quit'") + os.system("osascript -e 'tell app \"Finder\" to activate'") \ No newline at end of file