Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

Mac OS Xでデスクトップのアイコンの表示・非表示を切り替えるスクリプト

実行すると一時的にデスクトップの全アイコンを消すことができる。もう一度実行すると元に戻る。プレゼンテーションを行うときなどに便利。

cleardesk.sh
#!/bin/sh

ICON_STATUS=`defaults read com.apple.finder CreateDesktop`
if [ $ICON_STATUS -eq 0 ]
then
    NEW_STATUS=true
    echo デスクトップのアイコンを表示します。
else
    NEW_STATUS=false
    echo デスクトップのアイコンを非表示にします。
fi

defaults write com.apple.finder CreateDesktop -boolean $NEW_STATUS
killall Finder

動作確認はMac OS X 10.8で行った。

参考

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?