Skip to content

Instantly share code, notes, and snippets.

@mikaelhadler
Last active May 19, 2020 13:14
Show Gist options
  • Save mikaelhadler/76f780b1577c8da3be4713970f7b3474 to your computer and use it in GitHub Desktop.
Save mikaelhadler/76f780b1577c8da3be4713970f7b3474 to your computer and use it in GitHub Desktop.
#!/bin/bash
unsplash_user=$1
if ! [ -x "$(command -v feh)" ]; then
echo 'Error: feh is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v wget)" ]; then
echo 'Error: wget is not installed.' >&2
exit 1
fi
if [ "" = "$unsplash_user" ]; then
echo 'Error: You need to set a valid username unsplash.' >&2
exit 1
fi
wget "https://source.unsplash.com/user/${unsplash_user}/likes/1920x1080" -O $HOME/tmp/wallpaper.jpg
feh --bg-scale $HOME/tmp/wallpaper.jpg > /dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment