清空Mac啓動桌面的圖標

如果有文件夾需要留一個圖標A,把其他圖標刪除後,會剩餘空文件夾。把留下來的圖標A拖進文件夾再拖出來,空文件夾就自動刪除了。 最後再把圖標全部刪除。

 

# getconf DARWIN_USER_DIR
cd `getconf DARWIN_USER_DIR`com.apple.dock.launchpad/db
if [ -z "$1" ]; then
  echo "\033[1;36mUSAGE:\033[0m"
  echo .clearLaunchpad s \\t- search apps
  echo .clearLaunchpad r \\t- restore launchPad
  echo .clearLaunchpad d \\t- delete apps
  echo .clearLaunchpad del n \\t- delete apps except n
  exit
fi
if [ $1 == 's' ]; then
  echo search recoreds from apps
  sqlite3 db "select * from apps"
fi
if [ $1 == 'r' ]; then
  defaults write com.apple.dock ResetLaunchPad -bool true
  killall Dock
fi
if [ $1 == 'd' ]; then
  sqlite3 db "delete from apps"
  killall Dock
fi
if [ $1 == 'del' ]; then
  sqlite3 db "delete from apps where item_id!="$2
  killall Dock
fi

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章