无忧启动论坛

标题: 自动更换背景使用方法 [打印本页]

作者: qczstart    时间: 2012-12-3 19:39
标题: 自动更换背景使用方法
批处理是郭元洪大大编写的!
以下是批处理内容:
#===================================
!BAT                       by 郭元洪 UESTC 2012-09-10   v1
setlocal
if "%debug%"=="" set debug=off
debug %debug%
::跳转帮助
if "%1"=="" goto :help
if /i "%1"=="-h" goto :help
if /i "%1"=="--help" goto :help
::开始
set path=%1
set tmp=%path:~-1%
if not "%tmp%"=="/" set path=%path%/
set picnum=0
::图片计数
ls %path% | call :picnum
if %picnum%==0 && debug on && echo 没有文件 && exit
::计算随机序号
set /a [email=hit=%@random%]hit=%@random%[/email] %% %picnum% +1 > nul
set picnum=0
::根据序号设定背景
ls %path% | call :setpic
exit
::计数
:picnum
if "%1"=="" exit
set /a picnum=%picnum% + 1 > nul
shift
goto :picnum
exit
::设定
:setpic
if "%1"=="" exit
set /a picnum=%picnum% + 1 > nul
if %picnum%==%hit% && splashimage %path%%%1 > nul
if %picnum%==%hit% exit
shift
goto :setpic
exit
::帮助
:help
debug on
echo 功能:随机设置背景图片
echo 命令格式: %~nx0 [路径]
echo 路径中应该包含要设定的背景图片[目前并不检测格式,一律认为可加载].
exit
#===============================================
将以上内容保存到记事本文档后改名为autosp或者你喜欢的名字,注意:没有后缀的啊!
使用方法是:
graphicsmode -1 800:600
splashimage /bootgrub/autosp
#这个路径要以批处理文件的实际路径哦!
autosp /boot/picture/
font /boot/grub/unifont.hex.gz
#字体文件你自己下载把!
然后到/boot/picture/这个目录下下载自己喜欢的图片,名字随便把,但一定要转换bmp的位图格式,大小当然是800*600了

[ 本帖最后由 qczstart 于 2012-12-3 19:41 编辑 ]
作者: xintiandi    时间: 2012-12-4 20:05
感谢分享。都支持哪些格式的图片呢。压缩后的可以吗。
作者: 2012zhd    时间: 2012-12-5 08:10
标题: 回复 #2 xintiandi 的帖子
图片必须是bmp格式,GZ,LZMA压缩的都可以。
作者: cxmzlxb    时间: 2012-12-5 08:34
很好很强大!!!!!!
作者: suge    时间: 2012-12-6 23:27
ud下用不了啊,路径已加了(ud),不知为何。看来还是要用message了。
作者: qxhdly    时间: 2013-12-20 05:40
好很强大!!!!!!




欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) Powered by Discuz! X3.3