Add application configuration prompt for already-optimized systems

- Add check for application configuration when system is already optimized
- Prompt user to configure apps even if tmpfs mounts already exist
- Create standalone configure-apps-for-tmpfs.sh script
- Detect if applications are already configured (Firefox prefs check)
- Skip redundant configuration attempts with 'already configured' messages
- Add backup timestamp to avoid overwriting previous backups
- Update README with new configuration script

Benefits:
- Users with existing tmpfs can now configure applications
- Standalone script allows re-configuration without full optimizer run
- Smarter detection prevents duplicate configurations
- Better user experience for incremental optimization
This commit is contained in:
mindesbunister
2025-10-06 09:28:59 +02:00
parent 8e5e370e09
commit 03153f2380
3 changed files with 290 additions and 0 deletions

View File

@@ -550,6 +550,34 @@ analyze_and_prompt() {
echo " df -h /tmp/tmpfs-cache/* # Check tmpfs usage"
echo " swapon --show # Check zram status"
echo ""
# Check if applications are already configured for tmpfs
local current_user=$(logname 2>/dev/null || echo $SUDO_USER)
local user_home=$(eval echo ~$current_user)
local apps_configured=false
# Quick check if browsers are configured
if [[ -f "$user_home/.mozilla/firefox"/*default*/prefs.js ]] && \
grep -q "tmpfs-cache" "$user_home/.mozilla/firefox"/*default*/prefs.js 2>/dev/null; then
apps_configured=true
fi
if [[ ! $apps_configured ]]; then
echo "📱 Application Configuration:"
echo " ⚠️ Your applications are not yet configured to use tmpfs caches"
echo ""
read -p " Would you like to automatically configure your browsers and dev tools? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo ""
configure_applications_for_tmpfs
echo ""
success "Configuration complete! Restart your applications to use tmpfs caches."
fi
else
echo " ✅ Applications are configured to use tmpfs caches"
fi
echo ""
echo "🎯 Your system is fully optimized for maximum performance!"
exit 0
fi