kkkgo / dsm_login_bingwallpaper Goto Github PK
View Code? Open in Web Editor NEW群晖登录壁纸自动换
群晖登录壁纸自动换
如题
脚本任务删了以后个人桌面还是bing的,重新设置壁纸也没用。
当保存路径设为:/volume1/Sync Files/BingWallpaper
时无法保存壁纸。
将Sync Files
改为SyncFiles
后就可以保存。
[x]Collecting information...
Link:https://www.bing.com/th?id=OHR.MarinaDaGloria_ZH-CN6894795645_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp
Date:20220823
Title:里约热内卢的象征
Copyright:格洛里亚附近的码头和糖面包山,巴西里约热内卢 (© f11photo/Getty Images)
Keyword:格洛里亚附近的码头和糖面包山,巴西里约热内卢
Filename:bing_20220823_格洛里亚附近的码头和糖面包山,巴西里约热内卢.jpg
[x]Downloading wallpaper...
-rw-r--r-- 1 root root 333K Aug 24 14:58 /tmp/bing_20220823_格洛里亚附近的码头和糖面包山,巴西里约热内卢.jpg
[x]Copying wallpaper...
cp: target 'Files/BingWallpaper' is not a directory
Save:/volume1/Sync Files/BingWallpaper
ls: cannot access /volume1/Sync: No such file or directory
ls: cannot access Files/BingWallpaper: No such file or directory
sh: line 59: cd: /volume1/Sync: No such file or directory
chmod: cannot access 'bing_20220823_\346\240\274\346\264\233\351\207\214\344\272\232\351\231\204\350\277\221\347\232\204\347\240\201\345\244\264\345\222\214\347\263\226\351\235\242\345\214\205\345\261\261\357\274\214\345\267\264\350\245\277\351\207\214\347\272\246\347\203\255\345\206\205\345\215\242.jpg': No such file or directory
[x]Setting welcome msg...
[x]Applying login wallpaper...
[x]Clean...
sh: -c: line 97: syntax error: unexpected end of file
RT
我在登录页的html的head里加入了
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">'''
还是不起作用 请问有什么方式解决这个问题么
今天运行脚本发现壁纸没有换,文字也没有抓取完全,设置给邮件发了运行报告:
任务计划程序已完成计划任务。
任务: Get_Bingwallpaper
开始时间: Thu, 10 Jan 2019 11:24:29 GMT
结束时间: Thu, 10 Jan 2019 11:24:31 GMT
当前状态: 0 (正常)
标准输出/错误:
login_background_customize="yes"
login_welcome_title="神秘之境"
sed: invalid option -- '3'
Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...
-n, --quiet, --silent
suppress automatic printing of pattern space
-e script, --expression=script
add the script to the commands to be executed
-f script-file, --file=script-file
add the contents of script-file to the commands to be executed
--follow-symlinks
follow symlinks when processing in place
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if SUFFIX supplied)
-l N, --line-length=N
specify the desired line-wrap length for the `l' command
--posix
disable all GNU extensions.
-r, --regexp-extended
use extended regular expressions in the script.
-s, --separate
consider files as separate rather than as a single continuous
long stream.
-u, --unbuffered
load minimal amounts of data from the input files and flush
the output buffers more often
-z, --null-data
separate lines by NUL characters
--help display this help and exit
--version output version information and exit
If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret. All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.
不知道是哪里出了问题
升了DSM7.0后一直在用呢,突然有一天就不行了。下载的文件变成了_bing.jpg,
之前的版本可以设置个人桌面为bing壁纸,新的脚本没有这个功能了,可不可以教一下如何设置啊?谢谢!
登录页面壁纸会自动更换,桌面壁纸好像不能自动更换,是bug么?
脚本更换的壁纸不自动更新,希望解决。
2022年8月20日,在已经去掉第2行的注释,定义了savepath的情况下,执行脚本无法保存壁纸。
将代码的第29行的$word变量加上双引号
原代码29行为
cp -f $tmpfile $savepath/$date@$title-$word.jpg
替换为以下代码:
cp -f $tmpfile $savepath/$date@$title-"$word".jpg
将29行的文件名减少到只有日期,仍然无法保存,所以原因不是文件名过长。代码如下:
cp -f $tmpfile $savepath/$date.jpg
加上双引号后,可以正常保存。替换代码如下:
cp -f $tmpfile "$savepath/$date.jpg"
希望作者更新一下。
目前发现一个情况,将脚本和Photo station结合使用时,每次通过脚本保存到Photo station的相册目录地址中,无法让Photo station索引到这个图片。但是不通过ssh,给文件重新命名一下就能索引到了。有办法解决这个问题么
瞎改了下,也可以用。
主要是把链接后面的参数去掉,就是原图了。
https://www.bing.com/th?id=OHR.FishOwl_EN-US0921851280_UHD.jpg&rf=LaDigue_UHD.jpg&pid=hp&w=1920&h=1080&rs=1&c=4
https://www.bing.com/th?id=OHR.FishOwl_EN-US0921851280_UHD.jpg
savepath="/volume1/homes/admin/wallpaper"
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&uhd=1")
echo $pic|grep -q enddate||exit
link=$(echo https://www.bing.com$(echo $pic|sed 's/.\+"url"[:" ]\+//g'|sed 's/".\+//g'))
UHDLink=$(echo ${link%%&*})
date=$(echo $pic|sed 's/.\+enddate[": ]\+//g'|grep -Eo 2[0-9]{7}|head -1)
tmpfile=/tmp/$date"_bing.jpg"
wget -t 5 --no-check-certificate $link -qO $tmpfile
tmpfile_UHD=/tmp/$date"_bing_UHD.jpg"
wget -t 5 --no-check-certificate $UHDLink -qO $tmpfile_UHD
[ -s $tmpfile ]||exit
rm -rf /usr/syno/etc/login_background*.jpg
cp -f $tmpfile /usr/syno/etc/login_background.jpg &>/dev/null
cp -f $tmpfile /usr/syno/etc/login_background_hd.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default_wallpaper/01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_02.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_02.jpg &>/dev/null
title=$(echo $pic|sed 's/.\+"title":"//g'|sed 's/".\+//g')
copyright=$(echo $pic|sed 's/.\+"copyright[:" ]\+//g'|sed 's/".\+//g')
word=$(echo $copyright|sed 's/(.\+//g')
if [ ! -n "$title" ];then
cninfo=$(echo $copyright|sed 's/,/"/g'|sed 's/,/"/g'|sed 's/(/"/g'|sed 's/ //g'|sed 's/\//_/g'|sed 's/)//g')
title=$(echo $cninfo|cut -d'"' -f1)
word=$(echo $cninfo|cut -d'"' -f2)
fi
sed -i s/login_background_customize=.*//g /etc/synoinfo.conf
echo "login_background_customize=\"yes\"">>/etc/synoinfo.conf
sed -i s/login_welcome_title=.*//g /etc/synoinfo.conf
echo "login_welcome_title=\"$title\"">>/etc/synoinfo.conf
sed -i s/login_welcome_msg=.*//g /etc/synoinfo.conf
echo "login_welcome_msg=\"$word\"">>/etc/synoinfo.conf
if (echo $savepath|grep -q '/') then
cp -f $tmpfile $savepath/1080P/$date@$title-$word.jpg
cp -f $tmpfile_UHD $savepath/UHD/$date@$title-$word-UHD.jpg
fi
rm -rf /tmp/*_bing.jpg
rm -rf /tmp/*_bing_UHD.jpg
非常好用,感谢~!
需要先替换默认的登陆壁纸才能使用这个脚本
在设置->主题->勾选一个任意一张预选壁纸才能启用这个脚本.
普通NAS用户,哪怕是Administrator用户组的也没有权限完成这个脚本任务.
最好更新下教程.
设置保存文件夹路径无法保存
output.log内容 cp: target '.jpg' is not a directory
有建立共用资料夹
老师,我用这个脚本,登录界面的壁纸更改没问题,可是登陆进系统之后,桌面的壁纸还是原来系统默认的,这个能改吗?
也按教程先设置默认壁纸了,还是不行
RT,既然改了登录图,那就把DSM应用程序的登录图也改了吧?
谢谢大佬支持
$$$
您好,我在我的群晖中试了一下您的代码,发现了两个问题,如下:
$$$
1、您代码中“story=$(curl -s https://cn.bing.com/cnhp/coverstory)”中的网址,curl -s中返回的信息为 跳转到“https://www4.bing.com/cnhp/coverstory”,Po不到任何信息,将以上代码改为“story=$(curl -s https://www4.bing.com/cnhp/coverstory)”才能Po到信息。
$$$
2、您的代码中提到
sed -i s/login_background_customize=.*/login_background_customize="yes"/g /etc/synoinfo.conf
这个应该是开启用户自定义壁纸,但是没有作用,还是得手动开启一下。
可实际测试中,还是要点击右上角头像进行开启自定义壁纸操作。
$$$
另,请求您的帮助,问题如下:
我尝试获取"attribute"和"para1"两个字段然后合并替换/etc/synoinfo.conf中的login_welcome_msg=,但是运行后为空白。
例如,现在返回值为
"title":"跃动的蒙德里安","attribute":"美国,纽约","para1":"这段太长省略"
我想让login_welcome_msg=美国,纽约--这段太长省略
但是/etc/synoinfo.conf中会变成login_welcome_msg=“”
$$$
我的DSM版本是DSM 6.2-23511 该版本为测试版。
我的电子邮箱是:[email protected] 希望通过电子邮件与您交流。
更换登录页面壁纸的正常,但是更换桌面壁纸失效了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.