Giter Site home page Giter Site logo

linux-bing-wallpaper's Issues

Minimuim Go requirement? Compile fails on RHEL7 with Go 1.3.3

Is there a minimum version of Go required to build this? I get the following compile errors running on RHEL7 with go1.3.3 (which comes from the RHEL7 repo):

[xpi@localhost linux-bing-wallpaper]$ go build bing-wallpaper.go
# command-line-arguments
./bing-wallpaper.go:458: syntax error: unexpected range, expecting {
./bing-wallpaper.go:474: non-declaration statement outside function body
./bing-wallpaper.go:475: non-declaration statement outside function body
./bing-wallpaper.go:484: non-declaration statement outside function body
./bing-wallpaper.go:486: non-declaration statement outside function body
./bing-wallpaper.go:487: syntax error: unexpected }
[xpi@localhost linux-bing-wallpaper]$ go version
go version go1.3.3 linux/amd64
[xpi@localhost linux-bing-wallpaper]$ 

Failed to start from systemd

Can not run with systemctl --user start bing-wallpaper.service as README mentioned

status from systemctl --user status bing-wallpaper.service

Process: 1389 ExecStart=/workspace/projects/linux-bing-wallpaper/bing-wallpaper zh-CN true (code=exited, status=2)
Main PID: 1389 (code=exited, status=2)

Mar 04 18:27:47 ooxx systemd[476]: bing-wallpaper.service: Service hold-off time over, scheduling restart.
Mar 04 18:27:47 ooxx systemd[476]: bing-wallpaper.service: Scheduled restart job, restart counter is at 5.
Mar 04 18:27:47 ooxx systemd[476]: Stopped Bing Wallpaper of the Day as your Linux Desktop's wallpaper.
Mar 04 18:27:47 ooxx systemd[476]: bing-wallpaper.service: Start request repeated too quickly.
Mar 04 18:27:47 ooxx systemd[476]: bing-wallpaper.service: Failed with result 'exit-code'.
Mar 04 18:27:47 ooxx systemd[476]: Failed to start Bing Wallpaper of the Day as your Linux Desktop's wallpaper.

logs from journalctl --user-unit bing-wallpaper.service

Mar 04 18:27:45 ooxx systemd[476]: Started Bing Wallpaper of the Day as your Linux Desktop's wallpaper.
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: panic: strconv.ParseBool: parsing "": invalid syntax
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: goroutine 1 [running]:
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: main.check(0x6d76e0, 0xc420086d20)
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: /workspace/projects/linux-bing-wallpaper/bing-wallpaper.go:26 +0x4a
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: main.detect_de(0x92b9bcca1072ffa6, 0x8)
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: /workspace/projects/linux-bing-wallpaper/bing-wallpaper.go:57 +0x522
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: main.main()
Mar 04 18:27:45 ooxx bing-wallpaper[1359]: /workspace/projects/linux-bing-wallpaper/bing-wallpaper.go:359 +0x74
Mar 04 18:27:45 ooxx systemd[476]: bing-wallpaper.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 04 18:27:45 ooxx systemd[476]: bing-wallpaper.service: Failed with result 'exit-code'.
Mar 04 18:27:46 ooxx systemd[476]: bing-wallpaper.service: Service hold-off time over, scheduling restart.
Mar 04 18:27:46 ooxx systemd[476]: bing-wallpaper.service: Scheduled restart job, restart counter is at 1.
Mar 04 18:27:46 ooxx systemd[476]: Stopped Bing Wallpaper of the Day as your Linux Desktop's wallpaper.

It seems that go can't get XDG_CURRENT_DESKTOP env when starts from systemd because I do have that env (XDG_CURRENT_DESKTOP=XFCE), it works when run the binary directly. LoL

OS: ArchLinux x64 with xfce4 desktop

Typo causing lower-resolution picture set.

var (
markets = []string{"en-US", "zh-CN", "ja-JP", "en-AU", "en-UK", "de-DE", "fr-FR", "en-NZ", "en-CA"}
resolutions = []string{"1920x1200", "1920x1800", "1366x768", "1280x768", "1280x720", "1024x768"}
)

The second candidate in the list should be "1920x1080", otherwise we will fall back to the lower resolution of "1366x768".

Thanks a lot for your application. I enjoyed and appreciated it!

LXDE Support?

The script says:

fabio@a514:~$ bingwallpaper 
Pinging Bing API...
Bing Image of the day: http://www.bing.com/az/hprichbg/rb/DivingGondola_EN-US11480704756_1920x1200.jpg
Saving image to /home/fabio/Pictures/Bing/DivingGondola_EN-US11480704756_1920x1200.jpg
New wallpaper set successfully for LXDE.

but the wallpaper didn't get changed

Cron run detects wrong desktop

Running the app from Konsole works beautifully:

upstream uri:http://bing.com/th?id=OHR.BeaversBend_EN-US8963318493_1920x1200.jpg
Downloaded /home/joe/Pictures/Bing/OHR.BeaversBend_EN-US8963318493_1920x1200.jpg
setting wallpaper for plasma5
Set wallpaper for plasma5

But running via cron failed initially, due to a missing xdotool:


goroutine 1 [running]:
main.setPlasmaWallpaper({0xc000252050, 0x4c}, {0x7bdedd, 0x4})
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:240 +0x878
main.setWallpaper({0x7bdedd, 0x4}, {0xc000252050, 0x4c}, {0x0, 0x0}, {0xc00001a3a8, 0x16})
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:220 +0x611
main.main.func1.1(0xc00005af60)
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:464 +0xda
main.main.func1(0xc0000a66e0)
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:469 +0x319
github.com/urfave/cli.HandleAction({0x757980, 0x7e1290}, 0xc0000ca380)
	/home/joe/git/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:526 +0xa8
github.com/urfave/cli.(*App).Run(0xc0000ca380, {0xc000012210, 0x1, 0x1})
	/home/joe/git/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:288 +0x734
main.main()
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:510 +0x63f

I didn't need xdotool to run interactively, but I assume that's something to do with $DISPLAY and/or .Xauthority from cron. After installing xdotool, cron runs incorrectly detect the desktop as kde4:

upstream uri:http://bing.com/th?id=OHR.BeaversBend_EN-US8963318493_1920x1200.jpg
Downloaded /home/joe/Pictures/Bing/OHR.BeaversBend_EN-US8963318493_1920x1200.jpg
setting wallpaper for kde4
panic: exit status 1

goroutine 1 [running]:
main.errChk(...)
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:46
main.setPlasmaWallpaper({0xc0001b4050, 0x45}, {0x7bdedd, 0x4})
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:259 +0x847
main.setWallpaper({0x7bdedd, 0x4}, {0xc0001b4050, 0x45}, {0x0, 0x0}, {0xc0000c2378, 0x16})
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:220 +0x611
main.main.func1.1(0xc0000b2f00)
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:464 +0xda
main.main.func1(0xc0000e4840)
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:469 +0x319
github.com/urfave/cli.HandleAction({0x757980, 0x7e1290}, 0xc00010c380)
	/home/joe/git/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:526 +0xa8
github.com/urfave/cli.(*App).Run(0xc00010c380, {0xc0000981f0, 0x1, 0x1})
	/home/joe/git/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:288 +0x734
main.main()
	/home/joe/git/linux-bing-wallpaper/bing-wallpaper.go:510 +0x63f

Adding --desktop plasma5 to the crontab fixes this.

unsure how to get this to work

full disclosure: i'm very new to linux.
i installed it via pamac on Manjaro (KDE) from AUR (did not use terminal)
i added it to cron as shown here
Screenshot_20200624_145233

anything i'm missing?

Minimum plasma version

I get the following error message on stderr: "Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'evaluateScript' in interface 'org.kde.PlasmaShell' at object path '/PlasmaShell' (signature 's')"

I have Kubuntu 16.04 LTS with Plasma v5.5.5
What would be the minimum plasma version that has the method evaluateScript?

Possible Bug: panic: fork/exec /usr/bin/file: no such file or directory

~/Sources/linux-bing-wallpaper/linux-bing-wallpaper
Started linux-bing-wallpaper
upstream uri:http://bing.com/th?id=OHR.IvishakRiver_EN-US1566710821_1920x1200.jpg
panic: fork/exec /usr/bin/file: no such file or directory

goroutine 1 [running]:
main.errChk(...)
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:46
main.imageChk(0xc0000a88a0, 0x52, 0x67cdb, 0x67cdb)
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:86 +0x2e7
main.downloadWallpaper(0xc00001e7d0, 0x46, 0xc000024300, 0x23, 0x0, 0x0)
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:137 +0x54d
main.main.func1.1(0xc000060f60)
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:461 +0x9c
main.main.func1(0xc00012c9a0, 0x0, 0x0)
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:469 +0x449
github.com/urfave/cli.HandleAction(0x7c8940, 0x8606e0, 0xc00012c9a0, 0xc00012c9a0, 0x0)
	/home/alpine/Sources/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:526 +0x105
github.com/urfave/cli.(*App).Run(0xc00014a380, 0xc000012220, 0x1, 0x1, 0x0, 0x0)
	/home/alpine/Sources/linux-bing-wallpaper/vendor/github.com/urfave/cli/app.go:288 +0x675
main.main()
	/home/alpine/Sources/linux-bing-wallpaper/bing-wallpaper.go:510 +0x68c

Wrong image is downloaded on 50% of the days

screenshot

On ~50% of the days the actual image downloaded is not the picture of the day but a picture of a tropical island as seen on the screenshot.

The screenshot is done with the commit: c69f79f
The script is stared with the following command:
$ DESKTOP_SESSION=WM ./bing-wallpaper -market=en-US

Readme typo

Under install golang section

export GO111MODULE=ON should be replaced with export GO111MODULE=on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.