dylanaraps / pywal

🎨 Generate and change color-schemes on the fly.
MIT License
8.36k stars 325 forks source link

OS X Problems #330

Closed ForsHant closed 5 years ago

ForsHant commented 5 years ago

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

LukeTarr commented 5 years ago

I get this as well. OS Mojave 10.14 Python 3.7.0 imagemagick 7.0.8-14

hubwub commented 5 years ago

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.

LukeTarr commented 5 years ago

I get an error too (which I've attached as output.txt). Doesn't set my desktop black or removed the dock. I updated to the new patch on Mojave since my last comment.

OS Mojave 10.14.1 Python 3.7.0 imagemagick 7.0.8-14

LukeTarr commented 5 years ago

Forgot to attach: outupt.txt

yamini-krishnamurthy commented 5 years ago

Also facing this issue.

dstapp commented 5 years ago

Me too :-/

rcreasey commented 5 years ago

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: \
hubwub commented 5 years ago

@rcreasey What happens when you do a wal -c then you set the wallpaper? It's one of the ways I can get a wallpaper that I had problems with to work with wal.

I've been checking out the crash logs for Dock because it goes back to this ultimately. All the logs I've seen so far share the same problem.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString unsignedIntValue]: unrecognized selector sent to instance 0x600002dc85a0'
terminating with uncaught exception of type NSException
abort() called

Just that the instance is different for however long you don't resolve the issue for.

The other thing I wanted to check on was how did desktoppicture.db look when a successful wal command was made and then the difference when it gets corrupted? The data is being added in that the location of the wallpaper is in the database both in a successful wal command when it causes it to break.

johnallen3d commented 5 years ago

I've just run into this issue as well. I've noticed that when the system wallpaper is set to one of the Mojave dynamic wallpapers the Dock process isn't corrupted but the actual desktop wallpaper is not rotated. wal will choose a random image (or used the one given), generate a new theme etc. but the desktop remains. If I change the wallpaper via the System Preference application then run wal again 💥 ... This just recently started happening, I'm not sure if it was an unintended upgrade to imagemagick via brew upgrade.

rcreasey commented 5 years ago

@hubwub : Same thing as mentioned before. Screen goes black and "resets" to the default Mojave desktop picture:


~
❯ wal -c

~
❯ wal -i ~/Pictures/Wallpapers/wal/pinksunset4k.jpg
[I] image: Using image pinksunset4k.jpg.
[I] colors: Generating a colorscheme.
[I] colors: Using wal backend.
[I] colors: Generation complete.
[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: \
~
johnallen3d commented 5 years ago

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.

soifou commented 5 years ago

@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.

johnallen3d commented 5 years ago

Good to know, thanks @soifou!

rcreasey commented 5 years ago

Why is this issue closed? It's still not functional without trickery and I'd like it to just work they way it did in High Sierra.

dylanaraps commented 5 years ago

I don't have a macOS machine nor do I know if the bug still affects master (try master with the --vte flag.). If this requires an update to the wallpaper code this will have to come from someone running pywal under macOS.

I closed this issue as it has had no activity since early December and no one (till now) has shown further interest in solving this. I'll happily accept patches since I can't work on this directly.

rcreasey commented 5 years ago

Alright, I’ll take a look and see if that fixes it.

rcreasey commented 5 years ago

Yeah, alas that does not fix it.

The issue certainly seems to be due to the desktoppicture.db @soifou was referring to. When I run:

❯ wal -i /Users/rcreasey/Pictures/Wallpaper/pywal -e --vte
[I] image: Using image 4 - 82OZz7D.jpg.
[I] colors: Generating a colorscheme.
[I] colors: Using wal backend.
[I] colors: Generation complete.
[I] wallpaper: Set the new wallpaper.
[I] sequences: Set terminal colors.

[I] export: Exported all files.
[I] export: Exported all user files.

I end up with multiple rows in the data table:

sqlite> select * from data;
/Users/rcreasey/Pictures/Wallpaper/pywal/4 - 82OZz7D.jpg
/Users/rcreasey/Pictures/Wallpaper/pywal/4 - 82OZz7D.jpg
/Users/rcreasey/Pictures/Wallpaper/pywal/4 - 82OZz7D.jpg

Which apparently is causing the dock to continuously crash. Dropping the rows will let Dock restart, but then subsequent wal runs fail to change anything. Manually inserting a single row into the data table also fails to do anything (even if I killall Dock as @soifou suggests).

I'm not sure what changed in the Mojave desktop behavior. I'll see if I can poke around some more.

rcreasey commented 5 years ago

Heh, actually this was one google search away from being fixed:

https://github.com/tech-otaku/macos-desktop/blob/master/set-desktop-mojave.sh

There are some considerations that this script accounts for that might explain my issues, mainly multiple spaces and multiple monitors. Removing the spaces and unplugging a monitor allowed me to use the above script to set my wallpaper from the command line.

Here is the resulting desktoppicture.db

desktoppicture.db.zip

screen shot 2019-01-22 at 11 45 22 am

seve commented 5 years ago

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

dylanaraps commented 5 years ago

See: https://github.com/dylanaraps/pywal/issues/330#issuecomment-455290893

SultanSGillani commented 5 years ago

See: #330 (comment)

Regardless if the issue is still an issue it should stay open until someone with a mac can create a pull request to fix this?

Or am I wrong?

Maybe some workarounds should be mentioned in the wiki perhaps?

Thanks

casperstorm commented 5 years ago

I still encounter this issue. This is not fixed. Running 10.14.1 Mojave.

robwaz commented 5 years ago

Can you provide any additional detail? Most recent pywal works for me on 10.14.4 Mojave.

casperstorm commented 5 years ago

@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?

needmorecowbell commented 5 years ago

I have been able to get the terminal to stick by using the -n flag to skip changing the wallpaper. wal -n -i ~/path/to/image

n-xlkt commented 5 years ago

This issue should be reopened as it has not been fixed. Running 10.14.5

nraiha commented 5 years ago

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

robwaz commented 5 years ago

Is this issue occurring with the github version of pywal? Last I saw, the brew version had not been updated, and did not include my PR.

I’ll pull the latest version from github and look into it over the weekend.

nraiha commented 5 years ago

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

seajaysec commented 5 years ago

This issue still exists with the current version installed through pip3, but only when external displays are connected.

seve commented 5 years ago

Just for clarification, this issue is still occurring on all versions of pywal?

robwaz commented 5 years ago

I pulled the pip version and the GitHub version, no issues with one external display.
Mojave 10.14.6

@seajaysec, how many external displays do you have connected?

seajaysec commented 5 years ago

@robwaz I have two external displays connected. one's rotated 90 degrees - not sure if that's a factor.

sofubi commented 5 years ago

Just want to pitch in here as I'd really like to use this and I'm having issues. I'm running Mojave 10.14.6, two external monitors one with 90 degree rotation, installed via pip3 install --user https://github.com/dylanaraps/pywal/archive/master.zip just about five minutes ago and ran wal -i image.jpg which crashed my desktop/dock.

ghost commented 5 years ago

Can someone creative a video tutorial from scratch ? I think it will help the community if they watch how someone makes it work. Also what about Catalina no one is mentioning it.

kevsestrella commented 4 years ago

Happened to me once in Catalina, can't switch apps, no dock, etc. But can't replicate after, what I have done in between is the temporary fix rm ~/Library/Application Support/Dock/desktoppicture.db and brew install pidof

genkobar commented 4 years ago

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.

KaytonFletcher commented 4 years ago

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.

cxwx commented 4 years ago

mac os 10.15 sitll has this problem

robwaz commented 4 years ago

@cxwx, could you please try the solution proposed in #515 and update there if the issue still persists on 10.15?

cxwx commented 4 years ago

solved. with #515