Skip to content

Instantly share code, notes, and snippets.

@toke
Last active March 13, 2017 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toke/165bd8940bf697dc3e3c587a3d0991a1 to your computer and use it in GitHub Desktop.
Save toke/165bd8940bf697dc3e3c587a3d0991a1 to your computer and use it in GitHub Desktop.
Simple i3 lock screen
#!/usr/bin/env bash
icon="$HOME/Pictures/lock.png"
tmpbg='/tmp/screen.png'
(( $# )) && { icon=$1; }
scrot "$tmpbg"
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg"
#dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
exec i3lock -u -i "$tmpbg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment