Installation
NOTE: you need to have previously install a grub theme for this to work, as the necessary file paths would not be there otherwise. This script has only been run on linux mint so you may need to change the file paths in the script for other linux distros.
-
Download the grub_randomizer.py file. it does not matter where this file is located but after this is set up its best not to move it.
-
Now you need to set it up as a service so that it will run on startup. first create the grub-randomizer.service file:
sudo touch /etc/systemd/system/grub-randomizer.service
- Now copy this code into the grub-randomizer.service file and replace the file path to where you put the script. EX filepath: /home/USER/Downloads/grub_randomizer.py
you can use this command to edit the grub-randomizer.service file. to exit nano after pasting the code press Ctrl+X, then press 'y', then hit enter.
sudo nano /etc/systemd/system/grub-randomizer.service
[Unit]
Description=randomize grub
[Service]
ExecStart=sudo python3 /FILE/PATH/TO/SCRIPT.py
Type=oneshot
[Install]
WantedBy=multi-user.target
- now you need to enable the service
copy these commands and run them in the terminal
sudo systemctl enable grub-randomizer.service
sudo systemctl start grub-randomizer.service
- now you need to edit the grub file inside this directory add this line to the top
sudo nano /etc/default/grub
GRUB_THEME=/boot/grub/themes/GRUB_THEME/theme.txt
now reboot
Info
this script will work with any amount of grub themes without modifying the script. this script also will not choose the same grub theme 2 times in a row.