Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to make background black #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ $ ls /boot/EFI/BOOT
BOOTX64.EFI BOOTX64.PNG
```

To change a background, run `set-background.sh`, for example:
```bash
$ chmod +x ./set-background.sh
$ ./set-background.sh
Available backgrounds (./backgrounds):
1) black.png
2) ursamajor.png
Enter the number of background to set: 1
Success: black.png has been set as background.
```

## Additional Information

Additional information about configuring rEFInd may be found [here](http://www.rodsbooks.com/refind/configfile.html).
Binary file added backgrounds/black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backgrounds/ursamajor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot-ursamajor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions set-background.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

echo "Available backgrounds (./backgrounds):"
a=$(ls ./backgrounds)
c=0
for i in $a
do
c=$(($c+1))
printf "%3d) %s\n" $c $i
done

r=
read -p "Enter the number of background to set: " r

RED="\033[1;31m"
GREEN="\033[1;32m"
NC="\033[0m"

if ! ( echo $r | grep -qP "^\d+$" ) || [ $r -lt 1 ] || [ $r -gt $c ]
then
printf "${RED}Error:${NC} incorrect number.\n"
else
i=0
for el in $a
do
i=$(($i+1))
if [ $i -eq $r ]
then
cp "./backgrounds/${el}" background.png
printf "${GREEN}Success:${NC} ${el} has been set as background.\n"
break
fi
done
fi