Skip to content

Instantly share code, notes, and snippets.

@skyjia
Created August 19, 2014 14:14
Show Gist options
  • Save skyjia/008a19c08fa10ef7c777 to your computer and use it in GitHub Desktop.
Save skyjia/008a19c08fa10ef7c777 to your computer and use it in GitHub Desktop.
Hide/Show OSX Desktop Icons
#!/bin/bash
DIR="$HOME/Desktop"
FILE="$DIR/.hidden_icons"
# hide icons for Windows VM
always_hide() {
chflags hidden $DIR/\$RECYCLE.BIN
chflags hidden $DIR/desktop.ini
}
if [ -f $FILE ]
then
# found .hidden_icons
# show icons
chflags nohidden $DIR/*
rm -f $FILE
always_hide
else
# not found .hidden_icons
chflags hidden $DIR/*
touch $FILE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment