Advertisement
AWIRE9966_09onpc

Lubuntu

Jul 6th, 2025
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This script will install the Lubuntu desktop environment (LXQt)
  4. # and SDDM, then configure SDDM to be the default display manager.
  5.  
  6. # IMPORTANT:
  7. # - This script assumes you have a working Ubuntu-based installation.
  8. # - ALWAYS BACK UP YOUR DATA BEFORE MAKING SIGNIFICANT SYSTEM CHANGES.
  9. # - You will be prompted to select SDDM as the default display manager during execution.
  10. # - Run this script with 'sudo'.
  11.  
  12. echo "Starting Lubuntu Desktop (LXQt) and SDDM installation and configuration..."
  13.  
  14. # Step 1: Update package lists
  15. echo "Updating package lists..."
  16. sudo apt update || { echo "Error: Failed to update package lists. Exiting."; exit 1; }
  17. echo "Package lists updated."
  18.  
  19. # Step 2: Install Lubuntu Desktop metapackage and SDDM
  20. # The 'lubuntu-desktop' metapackage will pull in LXQt and its recommended applications.
  21. # It typically suggests or pulls in 'sddm' as a dependency.
  22. echo "Installing lubuntu-desktop (LXQt) and SDDM..."
  23. sudo apt install -y lubuntu-desktop sddm || { echo "Error: Failed to install lubuntu-desktop and SDDM. Exiting."; exit 1; }
  24. echo "Lubuntu Desktop and SDDM installation started."
  25.  
  26. # Step 3: Ensure SDDM is set as the default display manager.
  27. # This command is crucial. If other display managers (like gdm3, lightdm) are present
  28. # or were previously installed, this will prompt the user to choose.
  29. echo "Configuring SDDM as the default display manager..."
  30. echo "A blue, text-based prompt will appear. Please use arrow keys to select 'sddm' and press Enter."
  31. sudo dpkg-reconfigure sddm || { echo "Error: Failed to reconfigure SDDM. Please do it manually: sudo dpkg-reconfigure sddm"; }
  32. echo "SDDM configuration prompt handled. Ensure 'sddm' was selected."
  33.  
  34. # Step 4: Basic SDDM configuration (setting Lubuntu theme)
  35. # The Lubuntu desktop typically comes with its own SDDM theme.
  36. echo "Attempting to set Lubuntu's SDDM theme..."
  37. if [ -d "/usr/share/sddm/themes/lubuntu" ]; then
  38. # Create a config file to set the theme
  39. echo "[Theme]" | sudo tee /etc/sddm.conf.d/lubuntu-theme.conf > /dev/null
  40. echo "Current=lubuntu" | sudo tee -a /etc/sddm.conf.d/lubuntu-theme.conf > /dev/null
  41. echo "SDDM theme set to 'lubuntu'."
  42. else
  43. echo "Lubuntu SDDM theme directory '/usr/share/sddm/themes/lubuntu' not found."
  44. echo "Skipping automatic theme configuration. You can configure it manually later."
  45. echo "Common default themes like 'breeze' or 'elarun' might be used."
  46. fi
  47.  
  48. # Step 5: Clean up (optional)
  49. echo "Cleaning up unnecessary packages and cache..."
  50. sudo apt autoremove -y
  51. sudo apt clean
  52. echo "Cleanup complete."
  53.  
  54. echo "Lubuntu Desktop and SDDM installation and configuration complete!"
  55. echo "It is HIGHLY RECOMMENDED to REBOOT your system now for changes to take effect."
  56. echo "You should see the SDDM login screen after rebooting, and upon login, the Lubuntu (LXQt) desktop."
  57.  
  58. read -p "Do you want to reboot now? (y/N): " choice
  59. case "$choice" in
  60. y|Y ) echo "Rebooting..." && sudo systemctl reboot ;;
  61. * ) echo "Reboot skipped. Please reboot manually when you are ready." ;;
  62. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement