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

Cron run detects wrong desktop #46

Open
mrfuton opened this issue Nov 12, 2021 · 0 comments
Open

Cron run detects wrong desktop #46

mrfuton opened this issue Nov 12, 2021 · 0 comments

Comments

@mrfuton
Copy link

mrfuton commented Nov 12, 2021

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.

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

No branches or pull requests

1 participant