Created
June 11, 2025 15:20
-
-
Save 1998code/79b90acd0a1a2194320b5055798adb4c to your computer and use it in GitHub Desktop.
Reset Dia Bootup Animation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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