Saturday, 2 January 2016

Automatically use a different menu wallpaper for E2B

Change background based on the day of the week

Add the lines below to your \_ISO\MyE2B.cfg file (the first line should always be !BAT). Ensure that you have seven different .bmp.gz files in the \_ISO folder named Aurora0.bmp.gz to Aurora6.bmp.gz.

# get day of week
checktime | set A=
set /a dow=%A:~20,1% > nul
set A=
# we now have a number between 0 and 6 (0=Sunday, 6=Saturday)
set MYWBMP=/_ISO/Aurora%dow%.bmp.gz
set dow=

Check for December

Use a special Christmas wallpaper in December:

checktime | set A=
set  /a month=%A:~5,2% > nul
set A=
# 1 = January, 8=August, 12=December
if %month%==12 set MYWBMP=/_ISO/XMAS.bmp.gz
set month=

You could adapt this to pick one of 12 calendar bitmaps if you like (using set MYWBMP=/_ISO/Calendar/%month%.bmp to pick 1.bmp to 12.bmp)!

Random background

Add the lines below to your \_ISO\MyE2B.cfg file. Ensure that you have three different .bmp.gz files in the \_ISO folder named Aurora1.bmp.gz to Aurora3.bmp.gz.

# get a random number between 1 and 10
set /a randnum=%@random% / 3277 + 1 > nul
# if greater than 3 then get another number!
if %randnum%>=4 goto :rlp
# we now have a number between 1 and 3
set MYWBMP=/_ISO/Aurora%randnum%.bmp.gz
set randnum=

You can, of course, use .jpg files instead of .bmp.gz files and can change the path and name of the graphics files.
If you want to use GFXBoot menu files, just change the 'set MYWBMP=xxx' line to 'set GFX=xxx' (e.g. set GFX=docs/GFXMenu/message%dow%).
If you want more random number graphics files, change the '4' in the line 'if %randnum%>=4 goto :rlp' to a number between 3 and 11.