Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This script will install the Lubuntu desktop environment (LXQt)
- # and SDDM, then configure SDDM to be the default display manager.
- # IMPORTANT:
- # - This script assumes you have a working Ubuntu-based installation.
- # - ALWAYS BACK UP YOUR DATA BEFORE MAKING SIGNIFICANT SYSTEM CHANGES.
- # - You will be prompted to select SDDM as the default display manager during execution.
- # - Run this script with 'sudo'.
- echo "Starting Lubuntu Desktop (LXQt) and SDDM installation and configuration..."
- # Step 1: Update package lists
- echo "Updating package lists..."
- sudo apt update || { echo "Error: Failed to update package lists. Exiting."; exit 1; }
- echo "Package lists updated."
- # Step 2: Install Lubuntu Desktop metapackage and SDDM
- # The 'lubuntu-desktop' metapackage will pull in LXQt and its recommended applications.
- # It typically suggests or pulls in 'sddm' as a dependency.
- echo "Installing lubuntu-desktop (LXQt) and SDDM..."
- sudo apt install -y lubuntu-desktop sddm || { echo "Error: Failed to install lubuntu-desktop and SDDM. Exiting."; exit 1; }
- echo "Lubuntu Desktop and SDDM installation started."
- # Step 3: Ensure SDDM is set as the default display manager.
- # This command is crucial. If other display managers (like gdm3, lightdm) are present
- # or were previously installed, this will prompt the user to choose.
- echo "Configuring SDDM as the default display manager..."
- echo "A blue, text-based prompt will appear. Please use arrow keys to select 'sddm' and press Enter."
- sudo dpkg-reconfigure sddm || { echo "Error: Failed to reconfigure SDDM. Please do it manually: sudo dpkg-reconfigure sddm"; }
- echo "SDDM configuration prompt handled. Ensure 'sddm' was selected."
- # Step 4: Basic SDDM configuration (setting Lubuntu theme)
- # The Lubuntu desktop typically comes with its own SDDM theme.
- echo "Attempting to set Lubuntu's SDDM theme..."
- if [ -d "/usr/share/sddm/themes/lubuntu" ]; then
- # Create a config file to set the theme
- echo "[Theme]" | sudo tee /etc/sddm.conf.d/lubuntu-theme.conf > /dev/null
- echo "Current=lubuntu" | sudo tee -a /etc/sddm.conf.d/lubuntu-theme.conf > /dev/null
- echo "SDDM theme set to 'lubuntu'."
- else
- echo "Lubuntu SDDM theme directory '/usr/share/sddm/themes/lubuntu' not found."
- echo "Skipping automatic theme configuration. You can configure it manually later."
- echo "Common default themes like 'breeze' or 'elarun' might be used."
- fi
- # Step 5: Clean up (optional)
- echo "Cleaning up unnecessary packages and cache..."
- sudo apt autoremove -y
- sudo apt clean
- echo "Cleanup complete."
- echo "Lubuntu Desktop and SDDM installation and configuration complete!"
- echo "It is HIGHLY RECOMMENDED to REBOOT your system now for changes to take effect."
- echo "You should see the SDDM login screen after rebooting, and upon login, the Lubuntu (LXQt) desktop."
- read -p "Do you want to reboot now? (y/N): " choice
- case "$choice" in
- y|Y ) echo "Rebooting..." && sudo systemctl reboot ;;
- * ) echo "Reboot skipped. Please reboot manually when you are ready." ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement