- 🤔 Exploring new technologies and developing software solutions to our worlds tech problems.
wksama / mineearth Goto Github PK
View Code? Open in Web Editor NEW我的地球🌏--让卫星为你拍壁纸🛰
License: MIT License
我的地球🌏--让卫星为你拍壁纸🛰
License: MIT License
程序文件重命名为 EarthWallpaper
放 /opt/
目录
[Desktop Entry]
Name=EarthWallpaper
Comment=Earth Wallpaper https://github.com/WencoChen/MineEarth/releases
Exec=/opt/EarthWallpaper
Terminal=false
Type=Application
Categories=Application;
Hidden=false
X-GNOME-Autostart-enabled=true
NoDisplay=false
Name[zh_CN]=earthWallpaper
Comment[zh_CN]=https://github.com/WencoChen/MineEarth/
_, _, err = systemParametersInfo.Call(
uintptr(0x0020), //需要修改为20才能正常设置壁纸
uintptr(0x0000), //0
uintptr(unsafe.Pointer(filenameUTF16)),
uintptr(0x01|0x02), //1|2
)
前天开始图片就不自动更新了 ,服务器出问题了把。作者你看一下
$ /opt/EarthWallpaper
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4e5c8a]
goroutine 1 [running]:
github.com/nfnt/resize.Resize(0x37a, 0x37a, 0x0, 0x0, 0x5, 0x77b6a0, 0x0)
/home/wenco/go/pkg/mod/github.com/nfnt/[email protected]/resize.go:83 +0x3a
main.(*Wallpaper).draw(0xc000096cc0, 0x0, 0x0, 0x6, 0x0)
/mnt/e/go/src/earth/wallpaper.go:104 +0x24b
main.(*Wallpaper).Exec(0xc000096cc0)
/mnt/e/go/src/earth/wallpaper.go:47 +0xf6
main.main()
/mnt/e/go/src/earth/main.go:23 +0x30
$ uname -ra
Linux momo-hp 5.4.0-45-generic #49-Ubuntu SMP Wed Aug 26 13:38:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
建议使用 github.com/robfig/cron/v3 分钟内检查不消费算力,不会造成占用CPU过高问题
个人修改实例
Cron V3 has been released!
To download the specific tagged release, run:
go get github.com/robfig/cron/[email protected]
my code
package main
import (
"fmt"
"os"
"time"
"github.com/robfig/cron/v3"
)
const (
URL = "https://gitee.com/wencochen/No.8-Sunflower/raw/master/earth.png"
SCALE = 0.618
CACHE = false
)
var (
FilePath string
cacheDir = os.TempDir() + string(os.PathSeparator) + "wallpaper_cache"
)
func run() {
c := cron.New()
c.AddFunc("@every 1m", func() {
fmt.Println("@every 1m ok")
wallpaper := NewWallpaper()
wallpaper.Exec()
})
c.Start()
}
func main() {
wallpaper := NewWallpaper()
wallpaper.Exec()
go run()
for {
time.Sleep(90000000000000000000)//等待很久一个的时间,为了不让程序退出
fmt.Println("Sleep 90000000000000000000 ok")
}
}
这几天看着一直没有更新。尝试关闭进程又重开无效。后删除了Themes下的壁纸文件,又重启程序,结果仍旧加载回长时间未变的那张图片了。去向日葵官网看了下是在更新的,然后去码云看了下好像没有更新。是不是服务器有问题了呢?
上段时间遗址是一个图片一天,也不动。。。今天打开又好了。。。。哈哈哈,不知道作者打算更新个2.0版本不,已经推荐身边好多人用起来了,哈哈哈
作者你好,首先感谢你这个壁纸软件很好用。然后这几天的话已经快3天桌面壁纸地球画面不更新了,看了下向日葵官网是一直在更新的。麻烦作者你看下怎么回事
使用的是左右排列的两个屏幕,
地球成为了一个竖长的椭圆形.
在htop可以看到有十几个.
没看到作者提到,就自己查了查。有一个深度论坛的用户提到了几种方法:deepin中实现脚本开机自启的三种方法
试了下,前两种方法都不太成功。
第三种是在~/.config/autostart下加.desktop文件,比较可行。这个~/.config/autostart类似Windows的自启文件夹,每次开机自动执行里面每一个desktop文件.
[Desktop Entry]
Encoding=UTF-8
Name=linux
Type=Application
Terminal=false
Exec="可执行文件地址"
通过这样可以实现开机自启,deepin下是有效的。
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.