Tutorial

New updates and improvements to Roundfleet.

Important notice

The code examples and scripts provided in these tutorials are for educational purposes only. Roundfleet is not responsible for any issues, damages, or security vulnerabilities that may arise from the use, modification, or implementation of these examples. Always review and test code in a secure environment before using it in production systems.

Finder Customization Management on macOS

Customize and manage Finder preferences across your Roundfleet devices using command-line tools. This tutorial covers desktop display options, file visibility settings, interface customization, and enterprise-wide Finder configuration management.

Understanding macOS Finder Customization

Finder is the default file manager for macOS, and its behavior can be extensively customized using the defaults command. Key areas of customization include:

  • Desktop Display - Control what appears on desktop
  • File Visibility - Show/hide files and extensions
  • Interface Elements - Status bars, path displays, and warnings
  • Sorting Behavior - How files and folders are organized

Desktop Display Management

Show Hard Disks on Desktop

#!/bin/bash

# Enable hard disk display on desktop
echo "đŸ–Ĩī¸ Enabling hard disk display on desktop..."

defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Hard disks will now appear on desktop"
else
    echo "❌ Failed to update hard disk display setting"
    exit 1
fi

Show External Hard Drives on Desktop

#!/bin/bash

# Enable external drive display on desktop
echo "💾 Enabling external drive display on desktop..."

defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ External drives will now appear on desktop"
else
    echo "❌ Failed to update external drive display setting"
    exit 1
fi

Show Removable Media on Desktop

#!/bin/bash

# Enable removable media display on desktop
echo "đŸ’ŋ Enabling removable media display on desktop..."

defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Removable media (CDs, DVDs, iPods) will now appear on desktop"
else
    echo "❌ Failed to update removable media display setting"
    exit 1
fi

File Visibility Configuration

Show All Filename Extensions

#!/bin/bash

# Enable display of all file extensions
echo "📄 Enabling display of all file extensions..."

defaults write NSGlobalDomain AppleShowAllExtensions -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ All file extensions will now be visible"
    echo "â„šī¸  Files like 'document.txt' and 'app.app' will show their extensions"
else
    echo "❌ Failed to update file extension display setting"
    exit 1
fi

Show Hidden Files

#!/bin/bash

# Enable display of hidden files
echo "đŸ‘ī¸ Enabling display of hidden files..."

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Hidden files will now be visible in Finder"
    echo "âš ī¸  Warning: Hidden files contain system data - modify with caution"
else
    echo "❌ Failed to update hidden file display setting"
    exit 1
fi

Interface Enhancement Settings

Enable Status Bar

#!/bin/bash

# Enable Finder status bar
echo "📊 Enabling Finder status bar..."

defaults write com.apple.finder ShowStatusBar -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Status bar enabled - shows item count and available space"
else
    echo "❌ Failed to enable status bar"
    exit 1
fi

Show Full Path in Title Bar

#!/bin/bash

# Enable full path display in title bar
echo "đŸ›¤ī¸ Enabling full path display in title bar..."

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Full file paths will now appear in Finder title bar"
else
    echo "❌ Failed to enable path display in title bar"
    exit 1
fi

Keep Folders on Top When Sorting

#!/bin/bash

# Enable folders-first sorting
echo "📁 Enabling folders-first sorting..."

defaults write com.apple.finder _FXSortFoldersFirst -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Folders will now appear before files when sorting by name"
else
    echo "❌ Failed to update folder sorting preference"
    exit 1
fi

Security and Warning Settings

Enable Extension Change Warning

#!/bin/bash

# Enable warning before changing file extensions
echo "âš ī¸ Enabling file extension change warning..."

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Warning dialog will appear before changing file extensions"
else
    echo "❌ Failed to enable extension change warning"
    exit 1
fi

Enable iCloud Drive Removal Warning

#!/bin/bash

# Enable warning before removing items from iCloud Drive
echo "â˜ī¸ Enabling iCloud Drive removal warning..."

defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
killall Finder

if [ $? -eq 0 ]; then
    echo "✅ Warning dialog will appear before removing items from iCloud Drive"
else
    echo "❌ Failed to enable iCloud Drive removal warning"
    exit 1
fi

Expand Information Window Panes

#!/bin/bash

# Configure information window panes to be expanded by default
echo "🔍 Configuring information window panes..."

defaults write com.apple.finder FXInfoPanesExpanded -dict \
    General -bool true \
    OpenWith -bool true \
    Privileges -bool true

killall Finder

if [ $? -eq 0 ]; then
    echo "✅ General, Open With, and Privileges panes will be expanded by default"
else
    echo "❌ Failed to configure information window panes"
    exit 1
fi

Enterprise Finder Configuration Script

#!/bin/bash

# Roundfleet Finder Customization Tool
# Standardize Finder preferences across fleet devices

# Configuration
LOG_FILE="/var/log/roundfleet_finder.log"
BACKUP_DIR="/var/backups/roundfleet/finder"
CONFIG_FILE="/etc/roundfleet/finder_config.plist"

# Logging function
log_action() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
}

# Create backup directory
setup_directories() {
    if [[ ! -d "$BACKUP_DIR" ]]; then
        mkdir -p "$BACKUP_DIR"
        log_action "Created backup directory: $BACKUP_DIR"
    fi
    
    if [[ ! -d "$(dirname "$CONFIG_FILE")" ]]; then
        mkdir -p "$(dirname "$CONFIG_FILE")"
        log_action "Created configuration directory"
    fi
}

# Backup current Finder preferences
backup_current_settings() {
    local backup_file="$BACKUP_DIR/finder_backup_$(date +%Y%m%d_%H%M%S).plist"
    
    echo "đŸ“Ļ Creating backup of current Finder settings..."
    
    # Export current Finder preferences
    defaults export com.apple.finder "$backup_file" 2>/dev/null
    
    if [ $? -eq 0 ]; then
        echo "✅ Backup created: $backup_file"
        log_action "Backup created: $backup_file"
    else
        echo "âš ī¸  Warning: Could not create backup"
        log_action "Warning: Backup creation failed"
    fi
}

# Apply enterprise Finder configuration
apply_finder_configuration() {
    echo "🔧 Applying Roundfleet Finder configuration..."
    log_action "Starting Finder configuration deployment"
    
    # Desktop display settings
    echo "Configuring desktop display options..."
    defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
    defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
    defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
    
    # File visibility settings
    echo "Configuring file visibility options..."
    defaults write NSGlobalDomain AppleShowAllExtensions -bool true
    defaults write com.apple.finder _FXSortFoldersFirst -bool true
    
    # Interface enhancements
    echo "Configuring interface elements..."
    defaults write com.apple.finder ShowStatusBar -bool true
    defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
    
    # Security warnings
    echo "Configuring security warnings..."
    defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
    defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
    
    # Information window configuration
    echo "Configuring information window panes..."
    defaults write com.apple.finder FXInfoPanesExpanded -dict \
        General -bool true \
        OpenWith -bool true \
        Privileges -bool true
    
    # Restart Finder to apply changes
    echo "Restarting Finder to apply changes..."
    killall Finder
    
    if [ $? -eq 0 ]; then
        echo "✅ Finder configuration applied successfully"
        log_action "Finder configuration deployment completed successfully"
    else
        echo "❌ Failed to restart Finder"
        log_action "Error: Failed to restart Finder"
        return 1
    fi
}

# Verify configuration deployment
verify_configuration() {
    echo "🔍 Verifying Finder configuration..."
    
    local verification_passed=true
    
    # Check desktop display settings
    if [[ "$(defaults read com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null)" == "1" ]]; then
        echo "✅ Hard drives on desktop: Enabled"
    else
        echo "❌ Hard drives on desktop: Failed"
        verification_passed=false
    fi
    
    if [[ "$(defaults read com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null)" == "1" ]]; then
        echo "✅ External drives on desktop: Enabled"
    else
        echo "❌ External drives on desktop: Failed"
        verification_passed=false
    fi
    
    # Check file visibility
    if [[ "$(defaults read NSGlobalDomain AppleShowAllExtensions 2>/dev/null)" == "1" ]]; then
        echo "✅ Show all extensions: Enabled"
    else
        echo "❌ Show all extensions: Failed"
        verification_passed=false
    fi
    
    # Check interface elements
    if [[ "$(defaults read com.apple.finder ShowStatusBar 2>/dev/null)" == "1" ]]; then
        echo "✅ Status bar: Enabled"
    else
        echo "❌ Status bar: Failed"
        verification_passed=false
    fi
    
    if $verification_passed; then
        echo "✅ All Finder configurations verified successfully"
        log_action "Configuration verification passed"
        return 0
    else
        echo "❌ Some configurations failed verification"
        log_action "Configuration verification failed"
        return 1
    fi
}

# Generate configuration report
generate_report() {
    local report_file="/tmp/finder_config_report_$(date +%Y%m%d_%H%M%S).txt"
    
    {
        echo "Roundfleet Finder Configuration Report"
        echo "Generated: $(date)"
        echo "Hostname: $(hostname)"
        echo "User: $(whoami)"
        echo "======================================"
        echo ""
        
        echo "Desktop Display Settings:"
        echo "Hard drives on desktop: $(defaults read com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null || echo 'Not set')"
        echo "External drives on desktop: $(defaults read com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null || echo 'Not set')"
        echo "Removable media on desktop: $(defaults read com.apple.finder ShowRemovableMediaOnDesktop 2>/dev/null || echo 'Not set')"
        echo ""
        
        echo "File Visibility Settings:"
        echo "Show all extensions: $(defaults read NSGlobalDomain AppleShowAllExtensions 2>/dev/null || echo 'Not set')"
        echo "Show hidden files: $(defaults read com.apple.finder AppleShowAllFiles 2>/dev/null || echo 'Not set')"
        echo "Folders first: $(defaults read com.apple.finder _FXSortFoldersFirst 2>/dev/null || echo 'Not set')"
        echo ""
        
        echo "Interface Settings:"
        echo "Status bar: $(defaults read com.apple.finder ShowStatusBar 2>/dev/null || echo 'Not set')"
        echo "Path in title: $(defaults read com.apple.finder _FXShowPosixPathInTitle 2>/dev/null || echo 'Not set')"
        echo ""
        
        echo "Security Settings:"
        echo "Extension change warning: $(defaults read com.apple.finder FXEnableExtensionChangeWarning 2>/dev/null || echo 'Not set')"
        echo "iCloud removal warning: $(defaults read com.apple.finder FXEnableRemoveFromICloudDriveWarning 2>/dev/null || echo 'Not set')"
        
    } > "$report_file"
    
    echo "📊 Configuration report saved to: $report_file"
    log_action "Configuration report generated: $report_file"
}

# Restore from backup
restore_from_backup() {
    local backup_file="$1"
    
    if [[ ! -f "$backup_file" ]]; then
        echo "❌ Backup file not found: $backup_file"
        return 1
    fi
    
    echo "🔄 Restoring Finder settings from backup..."
    
    # Import backup
    defaults import com.apple.finder "$backup_file"
    
    if [ $? -eq 0 ]; then
        echo "✅ Settings restored from backup"
        killall Finder
        log_action "Settings restored from backup: $backup_file"
    else
        echo "❌ Failed to restore from backup"
        log_action "Error: Failed to restore from backup: $backup_file"
        return 1
    fi
}

# Reset to defaults
reset_to_defaults() {
    echo "🔄 Resetting Finder to default settings..."
    
    # Remove custom settings
    defaults delete com.apple.finder ShowHardDrivesOnDesktop 2>/dev/null
    defaults delete com.apple.finder ShowExternalHardDrivesOnDesktop 2>/dev/null
    defaults delete com.apple.finder ShowRemovableMediaOnDesktop 2>/dev/null
    defaults delete NSGlobalDomain AppleShowAllExtensions 2>/dev/null
    defaults delete com.apple.finder AppleShowAllFiles 2>/dev/null
    defaults delete com.apple.finder ShowStatusBar 2>/dev/null
    defaults delete com.apple.finder _FXShowPosixPathInTitle 2>/dev/null
    defaults delete com.apple.finder _FXSortFoldersFirst 2>/dev/null
    defaults delete com.apple.finder FXEnableExtensionChangeWarning 2>/dev/null
    defaults delete com.apple.finder FXEnableRemoveFromICloudDriveWarning 2>/dev/null
    defaults delete com.apple.finder FXInfoPanesExpanded 2>/dev/null
    
    killall Finder
    
    echo "✅ Finder reset to default settings"
    log_action "Finder reset to default settings"
}

# Main execution function
main() {
    local action="${1:-deploy}"
    
    log_action "=== Roundfleet Finder Customization Started ==="
    
    setup_directories
    
    case "$action" in
        "deploy")
            backup_current_settings
            apply_finder_configuration
            verify_configuration
            generate_report
            ;;
        "verify")
            verify_configuration
            ;;
        "report")
            generate_report
            ;;
        "restore")
            if [[ -n "$2" ]]; then
                restore_from_backup "$2"
            else
                echo "❌ Please specify backup file path"
                echo "Usage: $0 restore /path/to/backup.plist"
                exit 1
            fi
            ;;
        "reset")
            backup_current_settings
            reset_to_defaults
            ;;
        *)
            echo "Usage: $0 [deploy|verify|report|restore|reset]"
            echo ""
            echo "Commands:"
            echo "  deploy  - Apply Roundfleet Finder configuration (default)"
            echo "  verify  - Verify current configuration"
            echo "  report  - Generate configuration report"
            echo "  restore - Restore from backup file"
            echo "  reset   - Reset to default settings"
            exit 1
            ;;
    esac
    
    log_action "=== Roundfleet Finder Customization Completed ==="
}

# Execute main function
main "$@"

Configuration Reference

SettingCommandDescription
Hard drives on desktopShowHardDrivesOnDesktopDisplay internal drives on desktop
External drives on desktopShowExternalHardDrivesOnDesktopDisplay external drives on desktop
Removable media on desktopShowRemovableMediaOnDesktopDisplay CDs, DVDs, iPods on desktop
Show all extensionsAppleShowAllExtensionsDisplay file extensions for all files
Show hidden filesAppleShowAllFilesDisplay normally hidden system files
Status barShowStatusBarShow item count and disk space
Path in title_FXShowPosixPathInTitleDisplay full path in window title
Folders first_FXSortFoldersFirstSort folders before files
Extension warningFXEnableExtensionChangeWarningWarn before changing extensions
iCloud warningFXEnableRemoveFromICloudDriveWarningWarn before iCloud removal

Quick Reference Commands

Enable All Desktop Items

# Show all desktop items
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
killall Finder

Enable Full Visibility

# Maximum file visibility
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write com.apple.finder ShowStatusBar -bool true
killall Finder

Enable All Security Warnings

# Enable all security warnings
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true
defaults write com.apple.finder FXEnableRemoveFromICloudDriveWarning -bool true
killall Finder

Troubleshooting

Finder Not Restarting

# Force restart Finder
sudo pkill -f Finder
sleep 2
open /System/Library/CoreServices/Finder.app

Settings Not Applying

# Clear Finder cache and restart
sudo rm -rf ~/Library/Caches/com.apple.finder
killall Finder

Verify Settings Applied

# Check specific setting
defaults read com.apple.finder ShowStatusBar

# List all Finder settings
defaults read com.apple.finder

Security Considerations

  • Hidden files contain system data - modify with caution
  • File extensions help identify file types - consider security implications
  • Desktop items may clutter interface in shared environments
  • Test changes on individual devices before fleet deployment
  • Create backups before applying configuration changes

Important Notes

  • Changes require Finder restart to take effect
  • Some settings apply system-wide (NSGlobalDomain)
  • User-specific settings don't affect other accounts
  • Administrative privileges may be required for system-wide deployment
  • Backup current settings before making changes for easy restoration

Related Tutorials

Notification Management and User Experience Optimization on macOS

Advanced notification system management, productivity enhancement, distraction control, and enterprise communication policies for macOS devices with automated deployment and user experience analytics.

Jul 7, 2025

Menu Bar Customization and Icon Management on macOS

Customize menu bar icons, hide unwanted indicators, and manage user interface elements across macOS devices with enterprise-grade configuration management and user experience optimization.

Jul 7, 2025

Dock Management and Interface Customization on macOS

Advanced dock configuration, fleet-wide interface management, user experience optimization, and enterprise productivity enhancement for macOS devices with automated deployment and compliance monitoring.

Jul 7, 2025

Desktop Wallpaper Management on macOS

Manage desktop wallpapers across Roundfleet devices with enterprise branding policies, automated deployment, compliance monitoring, and centralized image management for consistent corporate identity.

Jul 7, 2025

Manage Badge Notifications on macOS

Learn how to remove, control, and manage badge notifications for applications and the entire dock on macOS devices using command-line scripts for enterprise deployment.

Jul 7, 2025

Set Screen Saver on macOS

Configure and deploy custom screen savers on Mac devices using scripts to manage slideshow styles, timing, and photo sources.

Jul 7, 2025

User Account Management on macOS

Learn how to create, manage, and configure user accounts on macOS devices using command-line tools. Comprehensive guide for admin and standard user creation, password policies, and enterprise user management.

Jul 7, 2025

User Account Deletion and Lifecycle Management on macOS

Learn how to safely delete user accounts, manage user data retention, implement secure offboarding procedures, and handle enterprise user lifecycle management on macOS devices.

Jul 7, 2025