all repos — dotfiles @ 27e36ef4188e0d481cbe9106053a90c0e1c35bcb

my *nix dotfiles

bin/lock.sh (view raw)

 1#!/usr/bin/env bash
 2
 3import -window root /tmp/lock.png
 4convert /tmp/lock.png -scale 10% -scale 1000% /tmp/lock.png
 5
 6# stolen from xero
 7function datamosh() {
 8	fileSize=$(wc -c < "$file")
 9	headerSize=10
10	skip=$(shuf -i "$headerSize"-"$fileSize" -n 1)
11	count=$(shuf -i 1-10 -n 1)
12	for i in $(seq 1 $count);do byteStr=$byteStr'\x'$(shuf -i 0-255 -n 1); done;   
13	printf $byteStr | dd of="$file" bs=1 seek=$skip count=$count conv=notrunc >/dev/null 2>&1
14}
15
16#steps=$(shuf -i 20-30 -n 1)
17#for i in $(seq 1 $steps);do datamosh "$file"; done
18
19#convert /tmp/lock.jpg /tmp/lock.png >/dev/null 2>&1
20#rm /tmp/lock.jpg
21#file=/tmp/lock.png
22
23i3lock -u -i /tmp/lock.png
24rm /tmp/lock.png