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.

Set Screen Saver on macOS

Learn how to configure and deploy screen savers on Mac devices using scripts. This allows you to set custom slideshow styles, idle times, and photo sources across your Mac fleet.

Basic Screen Saver Setup

Configure a slideshow screen saver with custom settings:

#!/bin/bash

# Screen saver configuration
STYLE="Ken Burns"
IDLE_TIME=300  # 5 minutes in seconds
SHUFFLE_PHOTOS=true
PHOTOS_PATH="/System/Library/Screen Savers/Default Collections/1-National Geographic"

# Set screen saver style
defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "$STYLE"

# Set idle time before activation
defaults -currentHost write com.apple.screensaver idleTime -int $IDLE_TIME

# Configure photo shuffle
defaults -currentHost write com.apple.screensaver ShufflePhotos -bool $SHUFFLE_PHOTOS

# Set photos folder path
defaults -currentHost write com.apple.screensaver PhotosFolderPath "$PHOTOS_PATH"

echo "Screen saver configured: Style=$STYLE, IdleTime=${IDLE_TIME}s"

Available Screen Saver Styles

Choose from Apple's built-in slideshow styles:

#!/bin/bash

# Available screen saver styles
STYLES=(
    "Floating"
    "Flip-up"
    "Reflections"
    "Origami"
    "Shifting Tiles"
    "Sliding Panels"
    "Photo Mobile"
    "Holiday Mobile"
    "Photo Wall"
    "Vintage Prints"
    "Ken Burns"
    "Classic"
)

# Function to set screen saver style
set_screen_saver_style() {
    local style="$1"
    local idle_time="${2:-600}"  # Default 10 minutes
    local photos_path="${3:-/System/Library/Screen Savers/Default Collections}"
    
    echo "Setting screen saver: $style"
    
    # Configure screen saver
    defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "$style"
    defaults -currentHost write com.apple.screensaver idleTime -int $idle_time
    defaults -currentHost write com.apple.screensaver PhotosFolderPath "$photos_path"
    
    echo "Screen saver configured successfully"
}

# Example: Set Ken Burns style with 5-minute idle time
set_screen_saver_style "Ken Burns" 300 "/Users/Shared/ScreenSaver Photos"

Interactive Screen Saver Manager

Script with user-friendly interface for configuration:

#!/bin/bash

# Function to display available styles
show_styles() {
    echo "Available Screen Saver Styles:"
    echo "1. Floating"
    echo "2. Flip-up"
    echo "3. Reflections"
    echo "4. Origami"
    echo "5. Shifting Tiles"
    echo "6. Sliding Panels"
    echo "7. Photo Mobile"
    echo "8. Holiday Mobile"
    echo "9. Photo Wall"
    echo "10. Vintage Prints"
    echo "11. Ken Burns"
    echo "12. Classic"
}

# Function to configure screen saver
configure_screen_saver() {
    local style="$1"
    local idle_minutes="$2"
    local shuffle="$3"
    local photos_folder="$4"
    
    local idle_seconds=$((idle_minutes * 60))
    
    # Set all configuration options
    defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "$style"
    defaults -currentHost write com.apple.screensaver idleTime -int $idle_seconds
    defaults -currentHost write com.apple.screensaver ShufflePhotos -bool $shuffle
    defaults -currentHost write com.apple.screensaver PhotosFolderPath "$photos_folder"
    
    # Kill System Preferences to force refresh
    killall "System Preferences" 2>/dev/null || true
    
    echo "✓ Screen saver configured:"
    echo "  Style: $style"
    echo "  Idle time: $idle_minutes minutes"
    echo "  Shuffle photos: $shuffle"
    echo "  Photos folder: $photos_folder"
}

# Default configuration
STYLE="Ken Burns"
IDLE_MINUTES=10
SHUFFLE_PHOTOS=true
PHOTOS_FOLDER="/System/Library/Screen Savers/Default Collections/1-National Geographic"

# Configure with defaults
configure_screen_saver "$STYLE" "$IDLE_MINUTES" "$SHUFFLE_PHOTOS" "$PHOTOS_FOLDER"

Enterprise Screen Saver Deployment

Deploy standardized screen saver settings across multiple devices:

#!/bin/bash

# Corporate screen saver configuration
CORPORATE_CONFIG() {
    # Company branding configuration
    local style="Classic"
    local idle_time=600  # 10 minutes
    local photos_path="/Library/Desktop Pictures/Corporate"
    local shuffle=false
    
    echo "Deploying corporate screen saver settings..."
    
    # Create corporate photos directory if it doesn't exist
    if [[ ! -d "$photos_path" ]]; then
        sudo mkdir -p "$photos_path"
        echo "Created corporate photos directory: $photos_path"
    fi
    
    # Apply settings
    defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "$style"
    defaults -currentHost write com.apple.screensaver idleTime -int $idle_time
    defaults -currentHost write com.apple.screensaver ShufflePhotos -bool $shuffle
    defaults -currentHost write com.apple.screensaver PhotosFolderPath "$photos_path"
    
    # Disable screen saver password requirement for corporate environment
    defaults write com.apple.screensaver askForPassword -int 0
    
    echo "Corporate screen saver configuration applied"
    echo "Style: $style | Idle: ${idle_time}s | Shuffle: $shuffle"
}

# Apply corporate configuration
CORPORATE_CONFIG

Screen Saver Status and Management

Check current screen saver settings and manage configuration:

#!/bin/bash

# Function to display current screen saver settings
show_current_settings() {
    echo "=== Current Screen Saver Settings ==="
    
    # Get current style
    local current_style=$(defaults -currentHost read com.apple.screensaver moduleDict 2>/dev/null | grep moduleName | cut -d'"' -f4)
    
    # Get idle time
    local idle_time=$(defaults -currentHost read com.apple.screensaver idleTime 2>/dev/null)
    
    # Get shuffle setting
    local shuffle=$(defaults -currentHost read com.apple.screensaver ShufflePhotos 2>/dev/null)
    
    # Get photos path
    local photos_path=$(defaults -currentHost read com.apple.screensaver PhotosFolderPath 2>/dev/null)
    
    echo "Style: ${current_style:-Not set}"
    echo "Idle time: ${idle_time:-Not set} seconds"
    echo "Shuffle photos: ${shuffle:-Not set}"
    echo "Photos folder: ${photos_path:-Not set}"
}

# Function to disable screen saver
disable_screen_saver() {
    defaults -currentHost write com.apple.screensaver idleTime -int 0
    echo "Screen saver disabled (idle time set to 0)"
}

# Function to enable screen saver with default settings
enable_screen_saver() {
    defaults -currentHost write com.apple.screensaver idleTime -int 600
    defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName "Ken Burns"
    echo "Screen saver enabled with default settings"
}

# Show current settings
show_current_settings

Usage with Roundfleet

  1. Choose your preferred screen saver style from the available options
  2. Set idle time in seconds (0 disables screen saver)
  3. Configure photo shuffle and source folder path
  4. Deploy through Roundfleet's remote script execution
  5. Monitor deployment in action history

Common Photo Paths

LocationPath
Default Collections/System/Library/Screen Savers/Default Collections
Desktop Pictures/Library/Desktop Pictures
User Pictures/Users/username/Pictures
Shared Folder/Users/Shared/ScreenSaver Photos

Troubleshooting

Settings not applied: Kill System Preferences and restart to refresh settings Photos not displaying: Verify folder path exists and contains image files Screen saver not activating: Check idle time setting and system sleep preferences


Note: Changes take effect immediately but may require restarting System Preferences to see in the GUI. Test configuration before mass deployment.

Related Tutorials

Reducing Motion and Transparency on macOS Devices

Learn how to configure accessibility settings to reduce motion and transparency on macOS devices using shell scripts for better user experience and performance optimization.

Jul 7, 2025

Set Up Policy Banners on macOS Devices

Learn how to create, manage, and deploy interactive policy banners for macOS devices to ensure compliance and communicate organizational policies effectively.

Jul 7, 2025

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

Finder Customization Management on macOS

Learn how to customize Finder preferences, desktop display options, file visibility settings, and interface elements on macOS devices using command-line scripts for fleet management.

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

Website Access Control on macOS

Implement comprehensive website blocking and allowlisting on macOS devices using hosts file management, DNS filtering, and enterprise policy controls for organizational security.

Jul 7, 2025

User Privilege Management and Security Compliance on macOS

Comprehensive user privilege management, administrator access control, security compliance monitoring, and automated privilege escalation detection for macOS devices in enterprise environments.

Jul 7, 2025