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

Support wallpaper from Unsplash #395

Merged
merged 5 commits into from Apr 13, 2023
Merged

Support wallpaper from Unsplash #395

merged 5 commits into from Apr 13, 2023

Conversation

MkQtS
Copy link
Contributor

@MkQtS MkQtS commented Apr 10, 2023

fix #276, cc @jjm2473

引入argon.@global[0].online_wallpaper,可设置为nonebingunsplashunsplash_CollectionID(仍兼容原配置argon.@global[0].bing_background,值为1时与此处bing等效)。其中unsplash为Unsplash每日壁纸,unsplash_CollectionID为来自指定Collection中的图片(如设置为unsplash_562095则会显示https://unsplash.com/collections/562095中的一张图片),图片缓存过期时间仍为原来的12小时。

尚未修改luci-app-argon-config,可以先这样启用:

uci set argon.@global[0].online_wallpaper='unsplash' && uci commit

问题:

  1. 通过uci修改argon.@global[0].online_wallpaper的值,修改后首次打开会显示本地默认背景,刷新后才会应用新配置,不知道为什么
  2. 不太懂luci app,如果接受此PR,可以麻烦大佬更新一下luci-app-argon-config吗😂

@SpeedPartner
Copy link
Collaborator

建议不要全随机,这样会导致部分图片质量不是太OK,可以用wallpaper分类中的图片(并且"也许"不会再获取到竖屏图片?).
测试随机:
https://source.unsplash.com/1920x1080/?wallpapers
但还是建议改成和必应一样每日更换:
https://source.unsplash.com/1920x1080/daily?wallpapers

关于问题2,你的命令&& uci commit后面估计是漏了个luci,也就是&& uci commit luci

@MkQtS
Copy link
Contributor Author

MkQtS commented Apr 10, 2023

感谢建议。

&& uci commit后面估计是漏了个luci

根据OpenWrt的文档

(uci commit) Writes changes of the given configuration file, or if none is given, all configuration files, to the filesystem

不加这里的luci是会提交所有uci更改的,应该不是这个原因。

@SpeedPartner
Copy link
Collaborator

可能是网络的关系...我发现unsplash国内直连太慢了
--max-time 1的话,我这里直接干脆一直不显示壁纸...

@MkQtS
Copy link
Contributor Author

MkQtS commented Apr 10, 2023

我也是国内直连,东京Fastly,没毛病,一直用的Chrome新标签拓展也没问题😂

image

传输的数据量很小,这个时间改大了应该不能改善问题吧,会页面卡更久?

@SpeedPartner
Copy link
Collaborator

我这边至少得改成3....就可以获取到url了,再刷新就能下载到图片,虽然下载也挺慢的,从模糊到清晰...
不改的话,我这边/var/run/argon_unsplash.url内一直都是空的,获取不到图片url.

另外&w=1920&h=1080这个url参数,我发现一些原本19201080的图,再添加这个参数后,就变17071080了,不知道啥情况.
并且如果原来图片是竖屏的,那么通过url裁切再放大,会非常模糊,噪点明显.

还有https://source.unsplash.com/1920x1080/?wallpapers还是有概率会获取到竖屏壁纸,感觉并不稳定,...
我看了下官方文档,想要获取指定方向的图片只能通过他们的Developer API获取,没法通过Source API的方式获取.

建议您有空的话,切换成Developer API,让用户自己去注册申请Developer API吧.不然我个人觉得体验真的不太行.

@MkQtS
Copy link
Contributor Author

MkQtS commented Apr 11, 2023

现在用的是daily wallpaper的链接,但愿不要有竖屏壁纸。

让用户申请API有点太魔幻了 还是凑合用吧

@SpeedPartner
Copy link
Collaborator

unsplash的Developer API注册申请还挺简单的(刚注册了一个),demo可以每天获取50次,也够用了.
有对壁纸质量有高标准需求的话,注册一个Developer API其实体验更佳.
当然真觉得麻烦的话,也有bing的壁纸可以选择.

@MkQtS
Copy link
Contributor Author

MkQtS commented Apr 13, 2023

找到解决图片分辨率问题的办法了,文档在这里例子,应该给图片url设置参数fit=crop(裁剪缩放,满足横纵两个方向分辨率要求),不加这个参数是默认fit=clip(只缩放不裁剪,只需满足一个方向分辨率要求) @SpeedPartner

@jerrykuku
Copy link
Owner

所以这个问题解决了吗?哈哈

@MkQtS
Copy link
Contributor Author

MkQtS commented Apr 13, 2023

所以这个问题解决了吗?哈哈

解决了,现在获取到的图片都是1920x1080的了

@jerrykuku
Copy link
Owner

那我先合并了,config那边,估计要18.06的功能也跟上次才能做修改。

@jerrykuku
Copy link
Owner

各位参与的大佬们,还有其它建议么?

@jerrykuku jerrykuku merged commit bce1a54 into jerrykuku:master Apr 13, 2023
@SpeedPartner
Copy link
Collaborator

SpeedPartner commented Apr 13, 2023

那我先合并了,config那边,估计要18.06的功能也跟上次才能做修改。

此PR我抽空改到18.06吧.
辛苦各位~

另外,config里关于webp的RP可以合并了哦,18.06也已经支持了

SpeedPartner added a commit to SpeedPartner/luci-theme-argon-18.06-patch that referenced this pull request Apr 13, 2023
SpeedPartner added a commit to SpeedPartner/luci-theme-argon-18.06-patch that referenced this pull request Apr 15, 2023
@SpeedPartner SpeedPartner mentioned this pull request Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

希望支持来自Unsplash的壁纸
4 participants