Skip to content

Instantly share code, notes, and snippets.

@embik
Created June 5, 2016 18:38
Show Gist options
  • Save embik/eef65b532c88c101af3c8b058084e5bc to your computer and use it in GitHub Desktop.
Save embik/eef65b532c88c101af3c8b058084e5bc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# handle being called from systemd service
if [ -z "$XDG_RUNTIME_DIR" ] && [ -z "$SWAYSOCK"]; then
uid=$(id -u $USER)
export XDG_RUNTIME_DIR="/run/user/"$uid"/"
export SWAYSOCK=$(find $XDG_RUNTIME_DIR -iname sway*sock)
fi
swaygrab /home/$USER/lockscreen.png
convert -blur 0x6 /home/$USER/lockscreen.png /home/$USER/lockscreen.png
swaylock -i /home/$USER/lockscreen.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment