Skip to content

Instantly share code, notes, and snippets.

@1998code
Created June 11, 2025 15:20
Show Gist options
  • Save 1998code/79b90acd0a1a2194320b5055798adb4c to your computer and use it in GitHub Desktop.
Save 1998code/79b90acd0a1a2194320b5055798adb4c to your computer and use it in GitHub Desktop.
Reset Dia Bootup Animation
#!/bin/bash
# DIA Browser Bootup Animation Script
# This script will show DIA's beautiful bootup animation by launching it with a fresh profile
echo "🎬 DIA Browser Bootup Animation Launcher"
echo "========================================"
echo ""
# Function to quit any running DIA instances
quit_dia() {
echo "πŸ” Checking for running DIA instances..."
if pgrep -f "Dia" > /dev/null; then
echo "⏹️ Closing existing DIA browser..."
# Try graceful quit first
osascript -e 'tell application "Dia" to quit' 2>/dev/null || true
sleep 2
# Force quit all DIA processes
pkill -9 -f "Dia" 2>/dev/null || true
pkill -9 -f "company.thebrowser.dia" 2>/dev/null || true
sleep 3
echo " βœ… DIA closed"
else
echo " ℹ️ No DIA instances running"
fi
}
# Function to reset DIA preferences
reset_dia_preferences() {
echo "πŸ”§ Resetting DIA preferences..."
# Reset the key preference flags that control onboarding
defaults delete company.thebrowser.dia hasPresentedOnboardingIntro 2>/dev/null || true
defaults delete company.thebrowser.dia SUHasLaunchedBefore 2>/dev/null || true
# Remove first run marker
rm -rf ~/Library/Application\ Support/Dia/User\ Data/First\ Run 2>/dev/null || true
echo " βœ… Preferences reset"
}
# Function to launch DIA with fresh profile
launch_dia_with_animation() {
echo "πŸš€ Launching DIA with bootup animation..."
# Create a unique temporary profile directory with more entropy
temp_profile="/tmp/dia_fresh_$(date +%s)_$$_$(openssl rand -hex 4)"
# Ensure the directory doesn't exist
rm -rf "$temp_profile" 2>/dev/null || true
echo " πŸ“ Creating fresh profile: $temp_profile"
# Launch DIA with additional flags to ensure first-run experience
/Applications/Dia.app/Contents/MacOS/Dia \
--user-data-dir="$temp_profile" \
--disable-background-mode \
--no-first-run \
--disable-default-apps \
--disable-extensions \
--new-window &
echo " βœ… DIA launched with completely fresh profile"
echo ""
echo "πŸŽ‰ The bootup animation should appear now!"
echo ""
echo "πŸ’‘ Tips:"
echo " β€’ Wait a few seconds for DIA to fully load"
echo " β€’ If no animation appears, the feature might be version-specific"
echo " β€’ Try running the script again for another attempt"
}
# Function to clean up old temporary profiles (optional)
cleanup_old_profiles() {
echo "🧹 Cleaning up old temporary profiles..."
find /tmp -name "dia_animation_*" -type d -mtime +1 -exec rm -rf {} \; 2>/dev/null || true
echo " βœ… Cleanup complete"
}
# Main execution
echo "This script will:"
echo "β€’ Close any running DIA browser instances"
echo "β€’ Launch DIA with a fresh profile to show the bootup animation"
echo "β€’ Clean up old temporary profiles"
echo ""
read -p "Continue? (Y/n): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo "❌ Cancelled."
exit 0
fi
echo ""
quit_dia
reset_dia_preferences
cleanup_old_profiles
launch_dia_with_animation
echo "πŸ“ Note: The bootup animation may not appear every time due to:"
echo " β€’ Version-specific availability"
echo " β€’ Server-side controls by The Browser Company"
echo " β€’ One-time only display (true first install only)"
echo ""
echo "πŸ’‘ If animation doesn't appear, try:"
echo " β€’ Running the script multiple times"
echo " β€’ Downloading a fresh copy of DIA"
echo " β€’ Checking for DIA updates"
echo ""
echo "🎬 Even without animation, you now have a fresh DIA instance!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment