My dotfiles for my Linux rice managed with stow and make
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lock.sh 1.4KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. lockwidth=256
  3. lockheight=256
  4. . /home/micah/.cache/wal/colors.sh
  5. convert /home/micah/.config/i3/scripts/lock/lock.png -fuzz 50% -fill "$color4" -opaque "#30AF91" /tmp/lock.png
  6. convert /tmp/lock.png -fuzz 10% -fill "$color0" -opaque "#FFFFFF" /tmp/lock.png
  7. convert /tmp/lock.png -resize "$lockwidth"x"$lockheight" /tmp/lock.png
  8. scrot /tmp/screen.png
  9. convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
  10. for s in `xrandr --listactivemonitors`; do
  11. if `echo $s | grep -qP '^\d+(/\d+)?x\d+(/\d+)?\+\d*\+\d*'`; then
  12. x="$(echo $s | grep -oP '^\d+')";
  13. y="$(echo $s | grep -oP 'x\d+'|cut -d'x' -f2)";
  14. xoffset="$(echo $s | grep -oP '\+\d+\+'|cut -d'+' -f2)";
  15. yoffset="$(echo $s | grep -oP '\+\d+$'|cut -d'+' -f2)";
  16. xpos="$((xoffset + (x/2) - (lockwidth/2)))";
  17. ypos="$((yoffset + (y/2) - (lockheight/2)))";
  18. convert /tmp/screen.png /tmp/lock.png -geometry +"$xpos"+"$ypos" -composite -matte /tmp/screen.png
  19. fi
  20. done
  21. i3lock -i /tmp/screen.png \
  22. --radius=124 --ring-width=7 \
  23. --insidecolor=00000000 --line-uses-inside \
  24. --insidevercolor=00000000 --veriftext="" \
  25. --insidewrongcolor=00000000 --wrongtext="" \
  26. --ringcolor=${color4:1:6}ff \
  27. --separatorcolor=${color4:1:6}ff \
  28. --keyhlcolor=${color0:1:6}ff \
  29. --bshlcolor=${color0:1:6}ff \
  30. --ringvercolor=${color0:1:6}ff \
  31. --ringwrongcolor=${color2:1:6}ff \
  32. rm -f /tmp/screen.png /tmp/lock.png