-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a9c8685
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# hideicons | ||
|
||
Display or hide the desktop icons from the command line. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
if ! [[ "$OSTYPE" == "darwin"* ]]; then | ||
echo "isarm only supports macOS." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$1" ] | ||
then | ||
result_read="defaults read com.apple.finder CreateDesktop" | ||
if $result_read | grep -q "true"; then | ||
defaults write com.apple.finder CreateDesktop false | ||
killall Finder | ||
echo "Desktop icons are hidden!" | ||
exit 0 | ||
elif $result_read | grep -q "false"; then | ||
defaults write com.apple.finder CreateDesktop true | ||
killall Finder | ||
echo "Desktop icons are shown!" | ||
exit 0 | ||
fi | ||
fi | ||
|
||
case "$1" in | ||
--help|-h) echo "Display or hide the desktop icons from the command line."; exit 0 | ||
;; | ||
--version|-v) echo "Version 0.0.1"; exit 0 | ||
;; | ||
esac |