diff options
| author | marcellus <msimon_fr@hotmail.com> | 2025-07-06 19:59:18 +0200 |
|---|---|---|
| committer | marcellus <msimon_fr@hotmail.com> | 2025-07-06 19:59:18 +0200 |
| commit | 639a137490b9a03fed183a5b0546fa1db16cf55f (patch) | |
| tree | d02eef8ec896fd4bdb5176324c8fe051bf0290ab | |
| parent | 5a78bd753742ac9491967304636743101a15d6c0 (diff) | |
feat: new glitchlock
| -rwxr-xr-x | scripts/glitchlock | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/scripts/glitchlock b/scripts/glitchlock index b9b5157..4d32b7d 100755 --- a/scripts/glitchlock +++ b/scripts/glitchlock @@ -6,50 +6,50 @@ # author: xero <x@xero.nu> http://xero.nu # requires: i3lock-color, imagemagick, scrot -maim /tmp/lock.png -convert /tmp/lock.png /tmp/lock.jpg -file=/tmp/lock.jpg - -function datamosh() { - fileSize=$(wc -c < "$file") - headerSize=1000 - skip=$(shuf -i "$headerSize"-"$fileSize" -n 1) - count=$(shuf -i 1-10 -n 1) - for i in $(seq 1 $count);do byteStr=$byteStr'\x'$(shuf -i 0-255 -n 1); done; - printf $byteStr | dd of="$file" bs=1 seek=$skip count=$count conv=notrunc >/dev/null 2>&1 -} - -steps=$(shuf -i 40-70 -n 1) -for i in $(seq 1 $steps);do datamosh "$file"; done - -GLITCHICON=${GLITCHICON:=""} -PARAM=(--bar-indicator --bar-orientation horizontal --bar-direction 1 --redraw-thread -t "" \ - --bar-step 50 --bar-total-width 250 --bar-base-width 50 --bar-max-height 100 --bar-periodic-step 50 \ - --bar-color 00000077 --keyhl-color 00666666 --ringver-color cc87875f --wrong-color ffff0000 \ - --verif-text="" --wrong-text="" --noinput-text="" ) - -LOCK=() -while read LINE -do - if [[ "$LINE" =~ ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) ]]; then - W=${BASH_REMATCH[1]} - H=${BASH_REMATCH[2]} - Xoff=${BASH_REMATCH[3]} - Yoff=${BASH_REMATCH[4]} - if [ ! -z "$GLITCHICON" ]; then - IW=`identify -ping -format '%w' $GLITCHICON` - IH=`identify -ping -format '%h' $GLITCHICON` - MIDXi=$(($W / 2 + $Xoff - $IW / 2)) - MIDYi=$(($H / 2 + $Yoff - $IH / 2)) - LOCK+=($GLITCHICON -geometry +$MIDXi+$MIDYi -composite) - fi - fi -done <<<"$(xrandr)" - -convert /tmp/lock.jpg /tmp/lock.png >/dev/null 2>&1 -rm /tmp/lock.jpg -file=/tmp/lock.png - -convert "$file" "${LOCK[@]}" "$file" - -LC_ALL="fr_FR.UTF-8" i3lock -f --indicator -k --time-color="458588ff" --date-color="458588ff" --verif-text="Vérification..." --wrong-text="" --wrong-font="Cousine Nerd Font" --noinput-text="Vide" -i "$file" --date-str="%A %e %B" > /dev/null 2>&1 +#maim /tmp/lock.png +#convert /tmp/lock.png /tmp/lock.jpg +#file=/tmp/lock.jpg + +#function datamosh() { +# fileSize=$(wc -c < "$file") +# headerSize=1000 +# skip=$(shuf -i "$headerSize"-"$fileSize" -n 1) +# count=$(shuf -i 1-10 -n 1) +# for i in $(seq 1 $count);do byteStr=$byteStr'\x'$(shuf -i 0-255 -n 1); done; +# printf $byteStr | dd of="$file" bs=1 seek=$skip count=$count conv=notrunc >/dev/null 2>&1 +#} + +#steps=$(shuf -i 40-70 -n 1) +#for i in $(seq 1 $steps);do datamosh "$file"; done + +#GLITCHICON=${GLITCHICON:=""} +#PARAM=(--bar-indicator --bar-orientation horizontal --bar-direction 1 --redraw-thread -t "" \ +# --bar-step 50 --bar-total-width 250 --bar-base-width 50 --bar-max-height 100 --bar-periodic-step 50 \ +# --bar-color 00000077 --keyhl-color 00666666 --ringver-color cc87875f --wrong-color ffff0000 \ +# --verif-text="" --wrong-text="" --noinput-text="" ) + +#LOCK=() +#while read LINE +#do +# if [[ "$LINE" =~ ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) ]]; then +# W=${BASH_REMATCH[1]} +# H=${BASH_REMATCH[2]} +# Xoff=${BASH_REMATCH[3]} +# Yoff=${BASH_REMATCH[4]} +# if [ ! -z "$GLITCHICON" ]; then +# IW=`identify -ping -format '%w' $GLITCHICON` +# IH=`identify -ping -format '%h' $GLITCHICON` +# MIDXi=$(($W / 2 + $Xoff - $IW / 2)) +# MIDYi=$(($H / 2 + $Yoff - $IH / 2)) +# LOCK+=($GLITCHICON -geometry +$MIDXi+$MIDYi -composite) +# fi +# fi +#done <<<"$(xrandr)" + +#convert /tmp/lock.jpg /tmp/lock.png >/dev/null 2>&1 +#rm /tmp/lock.jpg +#file=/tmp/lock.png + +#convert "$file" "${LOCK[@]}" "$file" +LC_ALL="fr_FR.UTF-8" i3lock-fancy-rapid 5 pixel 20 -f --indicator -k --time-color="c4e0e1ff" --date-color="c4e0e1ff" --verif-text="Vérification..." --wrong-text="" --wrong-font="Cousine Nerd Font" --noinput-text="Vide" --date-str="%A %e %B" --radius 100 -e --time-pos="ix:y + 250" --timeoutline-color=aaaaaaff --time-size=80 --date-size=35 --date-pos="tx:ty + 80" --inside-color=00000000 +#i3lock -f --indicator -k --time-color="458588ff" --date-color="458588ff" --verif-text="Vérification..." --wrong-text="" --wrong-font="Cousine Nerd Font" --noinput-text="Vide" -i "$file" --date-str="%A %e %B" > /dev/null 2>&1 |
