Skip to content

Instantly share code, notes, and snippets.

@yzdann
Created June 10, 2019 12:24
Show Gist options
  • Save yzdann/11375169ebe12f33a4ef094aa6ab0472 to your computer and use it in GitHub Desktop.
Save yzdann/11375169ebe12f33a4ef094aa6ab0472 to your computer and use it in GitHub Desktop.
#!/bin/bash
ICON=$HOME/.xlock/icon.png
TEMPBG=/tmp/screen.png
CMUS_STATUS=`cmus-remote -Q 2>/dev/null | head -1 | cut -d " " -f2`
if [ $CMUS_STATUS ]
then
cmus-remote -s
fi
scrot /tmp/screen.png
convert $TEMPBG -scale 10% -scale 1000% $TEMPBG
convert $TEMPBG $ICON -gravity center -composite -matte $TEMPBG
i3lock -u -i $TEMPBG
rm $TEMPBG
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment