Skip to content

Instantly share code, notes, and snippets.

@pabloab
Last active January 24, 2018 04:55
Show Gist options
  • Save pabloab/bb01c67ee35b661fc215543104401587 to your computer and use it in GitHub Desktop.
Save pabloab/bb01c67ee35b661fc215543104401587 to your computer and use it in GitHub Desktop.
[xclip bug 37 tester] Little tool created to test xclip issue #37 #xclip
#!/bin/bash
# Before used xmacrorec2 > test.macro, capturing from 0,0 to different points on screen.
# $ cat test-1000-1000.macro
# KeyStrPress Control_L
# KeyStrPress Shift_L
# KeyStrPress Print
# KeyStrRelease Print
# KeyStrRelease Shift_L
# KeyStrRelease Control_L
# MotionNotify 0 0
# ButtonPress 1
# MotionNotify 1000 1000
# ButtonRelease 1
## TODO
# - Option to switch to image/jpeg
# - Option to adjust sizes and steps
SLEEPTIME=2
XSIZE=10
YSIZE=10
XSIZESTEP=10
YSIZESTEP=10
IMAGETYPE="image/jpeg" # image/png
IMAGEEXTENSION="jpg" # png
rm -f SS-*
clear
sleep $SLEEPTIME
echo " [Info] test-10-10"
cat test-10-10.macro | xmacroplay -d 0 $DISPLAY > /dev/null 2>/dev/null
echo " [Info] xclip without verbose"
xclip -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-woverb--10-10.$IMAGEEXTENSION"
echo " [Info] xclip with verbose"
xclip -verbose -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-wverb.$IMAGEEXTENSION"
sleep $SLEEPTIME
echo " [Info] test-100-100"
cat test-100-100.macro | xmacroplay -d 0 $DISPLAY > /dev/null 2>/dev/null
echo " [Info] xclip without verbose"
xclip -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-woverb--100-100.$IMAGEEXTENSION"
echo " [Info] xclip with verbose"
xclip -verbose -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-wverb.$IMAGEEXTENSION"
sleep $SLEEPTIME
echo " [Info] test-1000-1000"
cat test-1000-1000.macro | xmacroplay -d 0 $DISPLAY > /dev/null 2>/dev/null
echo " [Info] xclip without verbose"
xclip -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-woverb--1000-1000.$IMAGEEXTENSION"
echo " [Info] xclip with verbose"
xclip -verbose -selection clipboard -t $IMAGETYPE -o > "SS-`date +%Y-%m-%d_%T`-wverb.$IMAGEEXTENSION"
sleep $SLEEPTIME
file SS-*.$IMAGEEXTENSION
#identify SS-*.$IMAGEEXTENSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment