Advertisement
Guest User

Untitled

a guest
Nov 11th, 2022
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Warn users before asking for consent
  4. echo """
  5. ***** WARNING *****
  6.  
  7. This script is just a fun thing I wrote
  8. after changing my own plymouth theme.
  9. Read through it first to make sure you
  10. understand what it will be doing. It
  11. requires root privileges via sudo. It
  12. comes with ABSOLUTELY ZERO SUPPORT from
  13. me. I have only tested it with PNG images
  14. with transparency and dimensions of roughly
  15. 250x250px.Feel free to modify it to suit
  16. your needs.
  17.  
  18. ***** END WARNING ***
  19. """
  20. # Ask user to proceed
  21. read -p "I've read and understand the warning [Y/N]: " WARNING
  22.  
  23. # If user consented, time to do work
  24. if [ $WARNING == "Y" ] || [ $WARNING == "y" ]; then
  25. # Define path to default plymouth theme
  26. ORIGPATH=/usr/share/plymouth/themes/mint-logo
  27.  
  28. # Backup default theme
  29. sudo cp -a $ORIGPATH $ORIGPATH-orig
  30. echo "Saved original theme to $ORIGPATH-orig."
  31.  
  32. # Ask for path to custom image
  33. echo
  34. read -p "Enter the full path to the desired splash image: " CUSTPATH
  35.  
  36. # Remove original animation*.png and throbber*.png files
  37. sudo rm $ORIGPATH/{animation,throbber}*.png
  38.  
  39. # Copy custom image to the theme
  40. sudo cp $CUSTPATH $ORIGPATH/animation-0001.png
  41. sudo cp $CUSTPATH $ORIGPATH/throbber-0001.png
  42.  
  43. # Update initramfs to implement the image change
  44. echo
  45. echo "Updating initramfs. This is going to take some time..."
  46. sudo update-initramfs -u
  47.  
  48. # Inform user to reboot the system to see the change
  49. echo
  50. echo "Reboot your system to see the change. Enjoy!"
  51.  
  52. # Inform user of how to revert the change
  53. echo
  54. echo "Use 'sudo cp -a $ORIGPATH-orig $ORIGPATH && sudo update-initramfs -u' to revert"
  55. echo
  56. else
  57. # Without user consent, exit
  58. echo
  59. echo "Exiting."
  60. echo
  61. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement