From f168ce8109ac1572565acf0c8f4cd5b186662212 Mon Sep 17 00:00:00 2001 From: Kai-Ming Guo Date: Thu, 15 Mar 2018 22:57:02 +0800 Subject: [PATCH] Add reset launchpad layout function The layout will have returned to the default, placing all bundled apps onto the first screen of Launchpad, and third party apps onto the secondary (and third, if applicable) screens --- plugins/available/osx.plugin.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/available/osx.plugin.bash b/plugins/available/osx.plugin.bash index c1d2b18b..044b4d7e 100644 --- a/plugins/available/osx.plugin.bash +++ b/plugins/available/osx.plugin.bash @@ -95,5 +95,18 @@ function prevcurl() { curl "$*" | open -fa $PREVIEW } +function refresh-launchpad() { + about 'Reset launchpad layout in macOS' + example '$ refresh-launchpad' + group 'osx' + + if [ $(uname) = "Darwin" ];then + defaults write com.apple.dock ResetLaunchPad -bool TRUE + killall Dock + else + echo "Sorry, this only works on Mac OS X" + fi +} + # Make this backwards compatible alias pcurl='prevcurl'