Skip to content

Commit

Permalink
screenshot entropy
Browse files Browse the repository at this point in the history
  • Loading branch information
isidroas committed Jun 9, 2024
1 parent 1e9c5ce commit ebbec28
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 30 additions & 2 deletions docs/screenshot_terminal.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# # enough entropy need too many key strokes
# dd if=/dev/random of=seed_file count=64 bs=1 > /dev/null
rm seed_file

CLASSNAME=$(head -c 6 /dev/urandom | base64 | tr -cd [:alnum:])

# gruvbox colors
Expand All @@ -24,18 +28,42 @@ colors=(
'-xrm' '*.background:#282828'
)

urxvt "${colors[@]}" +is -g 150x41 -b 0 +sb -name $CLASSNAME -fn "xft:FiraCode Nerd Font:pixelsize=20" -e python example.py &
urxvt -hold "${colors[@]}" +is -g 150x41 -b 0 +sb -name $CLASSNAME -fn "xft:FiraCode Nerd Font:pixelsize=20" -e python example.py &

RXVTWINDOWID=$(xdotool search --sync --classname "$CLASSNAME")

xdotool type -window $RXVTWINDOWID 'add_entropy timestamp'
xdotool key -window $RXVTWINDOWID Return
for i in {1..10}; do
for i in {1..32}; do
xdotool type -window $RXVTWINDOWID a
done
done
# xdotool type -window $RXVTWINDOWID 0
xdotool key -window $RXVTWINDOWID ctrl+c

xdotool type -window $RXVTWINDOWID add_entropy
xdotool key -window $RXVTWINDOWID Return
for i in {1..26}; do
xdotool type -window $RXVTWINDOWID a
done
xdotool key -window $RXVTWINDOWID ctrl+c

xdotool key -window $RXVTWINDOWID ctrl+l
xdotool type -window $RXVTWINDOWID random
xdotool key -window $RXVTWINDOWID Return
xdotool type -window $RXVTWINDOWID add_entropy
xdotool key -window $RXVTWINDOWID Return
xdotool type -window $RXVTWINDOWID asdfjkl
xdotool key -window $RXVTWINDOWID ctrl+c
xdotool type -window $RXVTWINDOWID random
xdotool key -window $RXVTWINDOWID Return

import -window $RXVTWINDOWID $(dirname $0)/screenshot.png
sleep 0.1

import -window $RXVTWINDOWID /tmp/out.png

# https://imagemagick.org/script/command-line-options.php#trim
/tmp/ImageMagick/utilities/magick /tmp/out.png -define trim:edges=south -trim $(dirname $0)/screenshot.png

kill %1

0 comments on commit ebbec28

Please sign in to comment.