pywal: OS X Problems

Downloaded pywal with pip3, used wal -i image.jpg then background turned black and Dock disappeared, so I’m unable to change background and show dock + some bugs appeared. No such problem as another user

OS Mojave MacBook Pro Mid 2012

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 41 (6 by maintainers)

Commits related to this issue

Most upvoted comments

With Mojave, I think there might have been changes in regards to how wallpapers are handled. It’s been discussed before in #302 and #292 in terms of getting a black background and the desktop being unusable.

A temporary fix is to delete the following file:

rm ~/Library/Application Support/Dock/desktoppicture.db

I still get an error even with the removal of the VTE that was mentioned in #302.

I’ve found an alternative approach to changing the wallpaper. After calling wal with a directory the file $HOME/.cache/wal/wal contains the path to the most recently used image. Given that I can use AppleScript to set the wallpaper successfully.

osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$(cat "$HOME/.cache/wal/wal")\""

NOTE: as I noted this only works after deleting desktoppicture.db and if I haven’t messed with System Preferences.

@robwaz It is also failing on 10.14.4 after i updated Mac OS. I have installed pywal with brew and am running the latest version (3.3.0).

I am running wal -i path-to-image in iTerm2. iTerm2 gets updated with new colors, however desktop turns black, and dock is locked/killed. Work around is still:

rm ~/Library/Application Support/Dock/desktoppicture.db

Can I provide a log, or anything else for you to try to debug it?

@johnallen3d no need to delete desktoppicture.db you can set the wallpaper path with sqlite.

I tinkered a script to fetch a random wallpaper and get rid of most of all these problems, here are the most relevant parts:

DIR=$HOME/Pictures/wallpapers

# fetch random wallpaper from unsplash
curl -o "$DIR/today" -J -L "https://source.unsplash.com/random/1920x1200" > /dev/null 2>&1

# set wallpaper on all desktop
sqlite3 $HOME/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '$DIR/today'"

# remove manually wal cache
rm -rf "$HOME/.cache/wal"

# generate colors palette, skip setting wallpaper
wal -i "$DIR/today" -n

# restart the Dock else the wallpaper wouldn't apply
killall Dock

Works great so far since High Sierra and now on Mojave.

I think you meant the pip3 version instead of brew. Pip3 version has not been updated in a while, at least not after 10 Jun. (as the pidof bug seems to still happen if .)

But yes, it seems working when cloned and installed or installed with command pip3 install --user https://github.com/dylanaraps/pywal/archive/master.zip

MacOS Catalina version 10.15.3: Attempting to set desktop wallpaper still breaks dock.

Solution for me was to make a script that simply runs wal -n -i $1 && osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$(cat "$HOME/.cache/wal/wal")\""

(thank you johnallen3d)

To be more specific, place that in a file (I named mine walit), and then run chmod u+x walit and chmod 744 walit to make it executable. Then you can run walit path_to_image and it should set the wallpaper and colors!

Obviously with more knowledge about shell scripts you can customize the wal command to fit your needs. The important part is appending the osascript command. Sorry this will probably appear to be a very obvious explanation for many, but as a novice I would appreciate these steps as I struggled to figure it out myself.

I just ran into this issue on my MBP running Catalina and fixed it by deleting desktoppicture.db, like others in this thread. When I next ran pywal, I got the following log in the terminal:

[I] image: Using image spacingout.jpg.
[I] theme: Set theme to _Users_valdimar_Pictures_lanham_spacingout_jpg_dark_None_None_1.1.0.json.
[I] colors: Found cached colorscheme.
[I] wallpaper: Set the new wallpaper.
[I] sequences: Set terminal colors.

[I] export: Exported all files.
[I] export: Exported all user files.
pidof: illegal option -- s
[I] reload: Reloaded environment.

It appears pywal is trying to use a pidof option that is not available in the brew distribution. Running it directly prints out a help message with no -s option:

 ~  pidof -s
pidof: illegal option -- s
Help:
	-k	Kill processes for given pid name
	  	  (Note: You must have sufficient privileges!)
	-l	List long output
	-h -?	This help screen
	-v	Print out the version info

This Linux man page for pidof does indeed describe a “single shot” -s option.

However, the pywal source has a check for ‘Darwin’ and should only be calling with -s on systems other than macOS:

    try:
        if platform.system() != 'Darwin':
            subprocess.check_output(["pidof", "-s", name])
        else:
            subprocess.check_output(["pidof", name])

https://github.com/dylanaraps/pywal/blob/e7d956ca18c72f52dd6c5f5c2e606d287d025723/pywal/util.py#L187

So, perhaps the OS check broke with Mojave and / or Catalina? It could also be an unrelated issue.

I second reopening this issue, running 10.14.16. wal -i ~/path/to/image breaks the desktop. Cannot change to any other desktop, background stays black and dock does not appear.

To rever the changes: rm ~/Library/Application Support/Dock/desktoppicture.db

Shouldn’t this issue be reopened? I’m still running into this issue

This issue persists for me as well. However with 3.2.1, the black desktop picture doesn’t stay. It attempts to be set and then resets back to the default Mojave desert picture.

~
❯ wal -i /Users/rcreasey/Pictures/Wallpapers/wal

~
❯ wpu
[I] image: Using image QWaD9_ag.png.
[I] theme: Set theme to _Users_rcreasey_Pictures_Wallpapers_wal_QWaD9_ag_png_dark_None_None_1.1.0.json.
[I] colors: Found cached colorscheme.
[I] wallpaper: Set the new wallpaper.
[I] sequences: Set terminal colors.




[I] export: Exported all files.
[I] export: Exported all user files.
[I] reload: Reloaded environment.
[I] reload: Use -g to generate an oomox theme.

~
❯
prompt_pure_async_callback:84: bad math expression: illegal character: \