Skip to content

Instantly share code, notes, and snippets.

@ldotlopez
Last active December 19, 2021 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldotlopez/e5600ea39f76328c24a8f3f6b388c0a6 to your computer and use it in GitHub Desktop.
Save ldotlopez/e5600ea39f76328c24a8f3f6b388c0a6 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
YT_VIDEO="https://www.youtube.com/watch?v=ydYDqZQpim8"
YT_URL="$(youtube-dl --get-url "$YT_VIDEO")"
OUTF="$HOME/.local/share/namibia/background.png"
mkdir -p "$(dirname -- "$OUTF")"
ffmpeg -y -ss 0 -i "$YT_URL" -vframes 1 -q:v 2 "$OUTF"
gsettings set org.gnome.desktop.background picture-uri "file://$OUTF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment