Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Jun 18, 2018
1 parent b1e05ed commit c69f79f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ So next time you boot your computer for the first time in a day, it'll update yo

## Easy commands

# The first param is Market
# The second param should be false to not loop infinitely (for cron)
# (otherwise, script will keep running and checking for the next update)
/usr/bin/bing-wallpaper -market=en-US -loop=true
/usr/bin/bing-wallpaper -market=en-US

## Example cron usage (crontab -e for your user)
```
Expand All @@ -43,12 +40,18 @@ So next time you boot your computer for the first time in a day, it'll update yo
A: On KDE Plasma 5, you have to unlock your desktop to receive wallpaper updates, there's no other way.

B: There is a racing problem when running bing-wallpaper with systemd. systemd can't guarantee to start
us after the desktop. So we may not detect the correct desktop thus can't set it to "WM" blindly.
it after the desktop. So we may not detect the correct desktop thus can't set it to "WM" blindly.

The solution is:

If the desktop information was resolved to null at system start, bing-wallpaper will retry next hour.
B1: If the desktop information was resolved to null at system start, bing-wallpaper will retry next hour.
If still null, then set the desktop to "WM". So for i3/openbox, it will not set your wallpaper immediately.

B2: use my other systemd user services, like checkprocess and network-real-online, to start bing-wallpaper after kde and after network is up and running.

There's no solution for cron for now. But you will hardly meet this case unless you boot your machine
exactly at the time the cron service runs.

## TODO

allow to specify desktop environment.
4 changes: 2 additions & 2 deletions bing-wallpaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ func setWallpaper(de, pic, picOpts string) {
setXfceWallpaper(pic)
}

if de == "kde" {
if de == "kde4" {
setKde4Wallpaper(pic)
}

if de == "kde5" {
if de == "plasma5" {
setPlasmaWallpaper(pic)
}

Expand Down

0 comments on commit c69f79f

Please sign in to comment.