dotfiles/bin/awall

10 lines
560 B
Bash
Executable File

#!/bin/sh
[ "$#" -ge 1 ] && echo ~/Pictures/Awall/"$1"* > ~/Pictures/.wallp
pkill -f "mpv.*wallpaper"
nohup xwinwrap -ni -fdt -fs -- mpv -wid WID "$(cat ~/Pictures/.wallp)" --profile=wallpaper >/dev/null 2>&1 &
if [ "$#" -ge 1 ]; then
ffmpeg -i "$(cat ~/Pictures/.wallp)" -vframes 1 -y ~/Pictures/Awall/wall.png
mogrify -interpolate Integer -filter point -resize 1920x1080 -gravity center -background black -extent 1920x1080 ~/Pictures/Awall/wall.png
gsettings set org.gnome.desktop.background picture-uri file://"$HOME"/Pictures/Awall/wall.png
fi