Loading

清空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

 

posted @ 2024-03-04 09:22  stono  阅读(32)  评论(0编辑  收藏  举报