dylanaraps / pywal

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

Reloding fails #614

Closed j0ker70 closed 2 years ago

j0ker70 commented 2 years ago

I am just installed pywal. I am trying it in my set background script. When I run my script the first time, pywal works perfectly. But then if I do a consecutive run, it doesn't load the new image. When I run wal it shows me a warning, [W] reload: GTK2 reload support requires Python 2.

This is my script:

#! /bin/sh

bgdir=$XDG_DATA_HOME/backgrounds
bgloc=$XDG_DATA_HOME/backgrounds/wal

if [ "$#" -ne 0 ]; then
    loc=$(readlink -f $1)
    if [ -f $loc ]; then
        cp $loc $bgloc
    elif [ -d $loc ]; then
        randomimg=$(find "$loc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)
        cp $randomimg $bgloc
    else
        notify-send "Error!" "Not a image or a directory."
        exit 1
    fi
else
    randomimg=$(find "$bgdir" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)
    cp $randomimg $bgloc
fi

if command -v wal &> /dev/null; then
    wal -i "$bgloc" -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun"
fi

nitrogen --save --set-zoom-fill $bgloc
j0ker70 commented 2 years ago

Added wal -c before running wal on my wallpaper and it solved the issue of reloading. But the warning is still there.