Skip to content

If I set the wallpaper twice in a row with the same image, it removes the wallpaper the second time #68

@hisnameisjimmy

Description

@hisnameisjimmy

If I set the wallpaper twice, the second time it will remove the wallpaper and set it to the default desktop wallpaper. The issue is, I can't rely on get to tell me that the wallpaper is correctly set. When the wallpaper is changed back to default, get still returns the wallpaper I set initially. In fact, on MacOS settings, it still shows the correct wallpaper. My program is setting the wallpaper every 24 hours, but it has to be able to reliably recover from a crash, waking from sleep, and timezone shifts. So what I want to do is be able to check if the wallpaper that is currently set is the correct one, and if not, change it. However, because I can't rely on get to do that, I'm not sure what to do.

Am I doing something wrong here? I've tried this on multiple computers and am running into this issue consistently. Maybe there's a good way to work around this limitation?

This is what it looks like if you're running it from the CLI:

// Set the wallpaper
$ /macos-wallpaper set ~/Pictures/wallpaper.jpg --screen all --scale auto
// Wallpaper gets set to this image

// Get the wallpaper
$ /macos-wallpaper get
// Correct image is returned
/wallpaper.jpg

// Run a second set
$ /macos-wallpaper set ~/Pictures/wallpaper.jpg --screen all --scale auto
// Wallpaper now becomes default desktop

// Get the wallpaper again
$ /macos-wallpaper get
// The image I set earlier is returned, even though the desktop is showing the default wallpaper
/wallpaper.jpg

Here's a gif that shows the issue:
CleanShot 2020-07-14 at 18 48 31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions