[macos] Update the dock from a config file

This commit is contained in:
2025-03-19 23:36:02 +00:00
parent 3db31bc2a6
commit 442043c7d9
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
Safari file:///System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.apple.Safari
Mail file:///System/Applications/Mail.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.apple.mail
Calendar file:///System/Applications/Calendar.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.apple.iCal
Reminders file:///System/Applications/Reminders.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.apple.reminders
Notes file:///System/Applications/Notes.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.apple.Notes
Ivory file:///Applications/Ivory.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.tapbots.Ivory
ReadKit file:///Applications/ReadKit.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist app.readkit.universal
Ghostty file:///Applications/Ghostty.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.mitchellh.ghostty
Visual Studio Code file:///Applications/Visual Studio Code.app/ persistentApps /Users/nikdoof/Library/Preferences/com.apple.dock.plist com.microsoft.VSCode
Downloads file:///Users/nikdoof/Downloads/ persistentOthers /Users/nikdoof/Library/Preferences/com.apple.dock.plist

View File

@@ -0,0 +1,15 @@
# Updates the dock
function update-dock() {
idx=1
while read entry; do
app_name=$(echo "$entry" | cut -d $'\t' -f 1)
app_path=$(echo "$entry" | cut -d $'\t' -f 2)
app_type=$(echo "$entry" | cut -d $'\t' -f 3)
idx=$((idx+1))
dockutil --no-restart -a "$(urldecode "$app_path")" > /dev/null 2>&1
if [ "$app_type" = "persisentApps" ]; then
dockutil --move "$app_name" -p $idx
fi
done < ~/.dotfiles/macos/.config/dockConfig.txt
killall Dock
}