Skip to content

Instantly share code, notes, and snippets.

@typemytype
Created May 7, 2020 21:21
Show Gist options
  • Save typemytype/391b3bbe23b96b96f7bda4ae68d2a5a2 to your computer and use it in GitHub Desktop.
Save typemytype/391b3bbe23b96b96f7bda4ae68d2a5a2 to your computer and use it in GitHub Desktop.
import os
import vanilla
def showHide(sender):
value = "true"
if "Hide" in sender.getNSButton().title():
value = "false"
os.system(f"defaults write com.apple.finder CreateDesktop {value} && killall Finder")
w = vanilla.Window((200, 70), "Desktop Icons")
w.button_show = vanilla.Button((10, 10, -10, 22), "Show Icons", callback=showHide)
w.button_hide = vanilla.Button((10, 40, -10, 22), "Hide Icons", callback=showHide)
w.open()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment