I've got Ambxst installed as module in my NixOS installation. When switching the wallpapers, it spawns a new instance of mpvpaper (as expected) but doesn't kill the old instance. Changing it multiple times accumulates a lot of orphaned mpvpaper instances.
Relevant source:
modules/widgets/dashboard/wallpapers/mpvpaper.sh
I've narrowed it down to pkill and pgrep unable to find the mpvpaper instance to kill because of the -x flag. In NixOS, the executable is wrapped with makeWrapper giving it a different name which -x is not robust enough to handle.
❯ ps -eo pid,comm,args | grep "mpvpaper"
116650 .mpvpaper-wrapp /nix/store/angyxynrfhkxkjfi1sh1i8ng5671s17q-Ambxst-env/bin/mpvpaper -o no-audio loop hwdec=auto scale=bilinear interpolation=no video-sync=display-resample panscan=1.0 video-scale-x=1.0 video-scale-y=1.0 load-scripts=no input-ipc-server=/tmp/ambxst_mpv_socket_eDP-2 eDP-2 /nix/store/ixv9sficcdljnv8dwq80j674bjkvk339-wallpapers/sunpixels/cafe_night.gif
Please note that the complete name for the comm is supposed to be .mpvpaper-wrapper but it gets truncated to .mpvpaper-wrapp. Since the comm name is not reliable, a better alternative would be to look into args with the -f flag.
I've tried pkill -f mpvpaper which is able to kill the mpvpaper instance and pgrep -f mpvpaper lists the PID for mpvpaper instance.
I'll raise a PR if the change request makes sense. Would love to know if that's the right way to go about and if there can be some hidden side-effects
I've got Ambxst installed as module in my NixOS installation. When switching the wallpapers, it spawns a new instance of mpvpaper (as expected) but doesn't kill the old instance. Changing it multiple times accumulates a lot of orphaned mpvpaper instances.
Relevant source:
modules/widgets/dashboard/wallpapers/mpvpaper.sh
I've narrowed it down to
pkillandpgrepunable to find the mpvpaper instance to kill because of the-xflag. In NixOS, the executable is wrapped with makeWrapper giving it a different name which-xis not robust enough to handle.Please note that the complete name for the comm is supposed to be
.mpvpaper-wrapperbut it gets truncated to.mpvpaper-wrapp. Since the comm name is not reliable, a better alternative would be to look into args with the-fflag.I've tried
pkill -f mpvpaperwhich is able to kill the mpvpaper instance andpgrep -f mpvpaperlists the PID for mpvpaper instance.I'll raise a PR if the change request makes sense. Would love to know if that's the right way to go about and if there can be some hidden side-effects