Skip to content

Instantly share code, notes, and snippets.

@mortezae
Forked from rg3915/_xmacroplay.md
Created November 15, 2019 20:00
Show Gist options
  • Save mortezae/da94b86ed276ecab47d3eb0a6ea0b17c to your computer and use it in GitHub Desktop.
Save mortezae/da94b86ed276ecab47d3eb0a6ea0b17c to your computer and use it in GitHub Desktop.
xmacroplay usage example.

#xmacroplay

Exemplo de uso do xmacroplay.

Usage:

sudo apt-get install xmacro
sudo apt-get install vim
wget --output-document=xmacroexample.sh https://goo.gl/Xt9KkU
source xmacroexample.sh

Experiment xmacroplay:

xmacrorec2 > commands.txt

Press <ESC>

Type your characters sequence.

Press <ESC>

xmacroplay -d 50 < commands.txt

See the your temp folder for more examples.

rm README.md
mkdir temp
echo "KeyStrPress Control_L" > temp/telas.txt
echo "KeyStrPress Shift_L" >> temp/telas.txt
echo "KeyStrPress t" >> temp/telas.txt
echo "KeyStrRelease t" >> temp/telas.txt
echo "KeyStrRelease Control_L" >> temp/telas.txt
echo "KeyStrRelease Shift_L" >> temp/telas.txt
echo "String vim README.md" > temp/openvim.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/openvim.txt
echo "String i" > temp/edit.txt
### file.txt ###
echo "KeyStrPress Shift_R KeyStrPress 3 KeyStrRelease 3 KeyStrRelease Shift_R" > temp/file.txt
echo "String xmacroplay" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String Exemplo de uso do xmacroplay." >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress 8 KeyStrRelease 8 KeyStrPress 8 KeyStrRelease 8 KeyStrRelease Shift_L" >> temp/file.txt
echo "String Usage:" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress 8 KeyStrRelease 8 KeyStrPress 8 KeyStrRelease 8 KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String sudo apt-get install xmacro" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String sudo apt-get install vim" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String source xmacroexample.sh" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress 8 KeyStrRelease 8 KeyStrPress 8 KeyStrRelease 8 KeyStrRelease Shift_L" >> temp/file.txt
echo "String Experiment xmacroplay:" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress 8 KeyStrRelease 8 KeyStrPress 8 KeyStrRelease 8 KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String xmacrorec2 " >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress period KeyStrRelease Shift_L KeyStrRelease period" >> temp/file.txt
echo "String commands.txt" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String Press " >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress comma KeyStrRelease Shift_L KeyStrRelease comma" >> temp/file.txt
echo "String ESC" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress period KeyStrRelease Shift_L KeyStrRelease period" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String Type your characters sequence." >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String Press " >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress comma KeyStrRelease Shift_L KeyStrRelease comma" >> temp/file.txt
echo "String ESC" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress period KeyStrRelease Shift_L KeyStrRelease period" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String xmacroplay -d 50 " >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress comma KeyStrRelease Shift_L KeyStrRelease comma" >> temp/file.txt
echo "String commands.txt" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/file.txt
echo "String See the your " >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "String temp" >> temp/file.txt
echo "KeyStrPress Shift_L KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrPress dead_acute KeyStrRelease dead_acute KeyStrRelease Shift_L" >> temp/file.txt
echo "String folder for more examples." >> temp/file.txt
### file.txt ###
echo "KeyStrPress Escape KeyStrRelease Escape" > temp/escape.txt
echo "KeyStrPress Shift_R" > temp/save.txt
echo "KeyStrPress semicolon" >> temp/save.txt
echo "KeyStrRelease Shift_R" >> temp/save.txt
echo "KeyStrRelease semicolon" >> temp/save.txt
echo "KeyStrPress w" >> temp/save.txt
echo "KeyStrPress q" >> temp/save.txt
echo "KeyStrRelease w" >> temp/save.txt
echo "KeyStrRelease q" >> temp/save.txt
echo "KeyStrPress Return" >> temp/save.txt
echo "KeyStrRelease Return" >> temp/save.txt
echo "String echo " > temp/done.txt
echo "KeyStrPress Shift_R KeyStrPress apostrophe KeyStrRelease apostrophe KeyStrRelease Shift_R" >> temp/done.txt
echo "String Done" >> temp/done.txt
echo "KeyStrPress Shift_R KeyStrPress apostrophe KeyStrRelease apostrophe KeyStrRelease Shift_R" >> temp/done.txt
echo "KeyStrPress Return KeyStrRelease Return" >> temp/done.txt
xmacroplay -d 10 < temp/telas.txt
sleep 1
xmacroplay -d 10 < temp/openvim.txt
sleep 1
xmacroplay -d 10 < temp/edit.txt
sleep 1
xmacroplay -d 30 < temp/file.txt
sleep 1
xmacroplay -d 10 < temp/escape.txt
xmacroplay -d 50 < temp/save.txt
xmacroplay -d 25 < temp/done.txt
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment