diff --git a/Perso/i3-lockscreenshot.sh b/Perso/i3-lockscreenshot.sh new file mode 100755 index 0000000..ff7fe96 --- /dev/null +++ b/Perso/i3-lockscreenshot.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Credit github user iambecomeroot, MIT licence +# https://github.com/iambecomeroot/dotfiles/blob/master/bin/bin/lock +# Modified by trotFunky + +rectangles=" " + +#scrot_options="-scale 5% -scale 2000%" # Pixelate +scrot_options="-blur 0x3" + +SR=$(xrandr --query | grep ' connected' | grep -o '[0-9][0-9]*x[0-9][0-9]*[^ ]*') +for RES in $SR; do + SRA=(${RES//[x+]/ }) + CX=$((${SRA[2]} + 25)) + CY=$((${SRA[1]} - 80)) + rectangles+="rectangle $CX,$CY $((CX+300)),$((CY-80)) " +done + +TMPBG=/tmp/screen.png +scrot $TMPBG && convert $TMPBG $scrot_options -draw "fill black fill-opacity 0.4 $rectangles" $TMPBG + +i3lock \ + -i $TMPBG \ + -e --force-clock \ + --timepos="ix-100:iy" \ + --datepos="tx:ty+25" \ + --clock --datestr "%A, %d/%m/%Y" \ + --insidecolor=00000000 --ringcolor=ffffffff --line-uses-inside \ + --keyhlcolor=d23c3dff --bshlcolor=d23c3dff --separatorcolor=00000000 \ + --insidevercolor=fecf4dff --insidewrongcolor=d23c3dff \ + --ringvercolor=ffffffff --ringwrongcolor=ffffffff --indpos="x+290:h-120" \ + --radius=20 --ring-width=3 \ + --greetertext="" --veriftext="" --wrongtext="" --noinputtext="" \ + --greetercolor="ffffffff" --timecolor="ffffffff" --datecolor="ffffffff" + +rm $TMPBG