Open ppenguin opened 1 year ago
Does your wallpaper actually change with this?
hyprctl hyprpaper unload "~/.cache/styli.sh/wallpaper.jpg" && hyprctl hyprpaper preload "~/.cache/styli.sh/wallpaper.jpg"
For me, even when i do something like this:
apply.sh
# Doing this works. # # Kill hyprpaper # # This is needed because # # hyprpaper does not notice changes. # pkill hyprpaper # # # Run hyprpaper and disown it. # nohup hyprpaper </dev/null >/dev/null 2>&1 & # completely detached from terminal
hyprctl hyprpaper unload "~/.config/hypr/assets/wallpaper.png" hyprctl hyprpaper preload "~/.config/hypr/assets/wallpaper.png" hyprctl hyprpaper wallpaper ",~/.config/hypr/assets/wallpaper.png"
Nothing changes.
Output for hyprpaper:
./apply.sh
ok ok ok
hyprpaper logs:
[LOG] Received a request: unload ~/.config/hypr/assets/wallpaper.png [LOG] Unloading target /home/enmei/.config/hypr/assets/wallpaper.png, preload path /run/user/1002/.hyprpaper_U0mC2c [LOG] Accepted incoming socket connection request on fd 5 [LOG] Closing Accepted Connection [LOG] Accepted incoming socket connection request on fd 5 [LOG] Received a request: preload ~/.config/hypr/assets/wallpaper.png [LOG] Preloaded target /home/enmei/.config/hypr/assets/wallpaper.png in 15.15ms -> Pixel size: [1600, 900] [LOG] Buffer created for target /home/enmei/.config/hypr/assets/wallpaper.png, Shared Memory usage: 5.8MB [LOG] Total SM usage for all buffers: 5.8MB [LOG] Accepted incoming socket connection request on fd 5 [LOG] Closing Accepted Connection [LOG] Accepted incoming socket connection request on fd 5 [LOG] Received a request: wallpaper ,~/.config/hypr/assets/wallpaper.png [LOG] Accepted incoming socket connection request on fd 5 [LOG] Closing Accepted Connection
It's a while ago, but I looked it up, and it seems it works for me.
I wrote a plugin for styli.sh
that is executed when styli.sh
runs to fetch a new wallpaper, and looks like this:
setwall_hyprpaper() {
# shellcheck disable=SC2088
($SETWALL_EXE hyprpaper unload "$WALLPAPER" && hyprctl hyprpaper preload "$WALLPAPER" ) 2>&1 | outdbg
# for now brute-force on all known monitors, because monitor wildcard doesn't work right
$SETWALL_EXE monitors | awk '$1~/^Monitor/{print $2}' | while read -r m; do
$SETWALL_EXE hyprpaper wallpaper "$m,$WALLPAPER" 2>&1 | outdbg
done
}
Since the timed run indeed resets my WP, it appears to work...
@ppenguin FYI you can use -j
flag to output JSON and then jq
to parse it:
$ hyprctl monitors -j | jq -r '.[0].name'
DP-1
Description
If one keeps the current wallpaper under the same filename in a cache (e.g. the standard behaviour of
styli.sh
), it would be convenient to supportreload
after a file contents have changed, i.e.becomes