I wanted an easy way to convert ducky script to uploadable Arduino code for the Digispark development board.
Unfortunately, in order to do this you must use 2 projects/softwares:
The duck2spark
project and the mame82/duckencoder.py
project.
Also you must do everything manually, and it sucks when moving systems because you have to make sure all dependencies such as Python and Java are correctly installed.
Use Docker of course! That way we can develop our script on our local machine, run a small docker command, and everything is done for us within a container and we get only the output we need.
I'm new to Docker, the Dockerfile may look bad. If so, please make an issue explaining why. I want to get better at Docker, not worse.
- Docker
- Common sense
- Run this one-liner:
$ docker build -t suce/ducky2spark github.com/NurdTurd/docker-ducky2spark
- Clone this repo to your local machine.
- Linux:
$ git clone https://github.com/NurdTurd/docker-ducky2spark.git
- Windows: Google it.
- Next, within a terminal, enter the directory.
- Run
$ docker build -t suce/ducky2spark .
Now that we've "installed" it, let's look at the usage.
Once you have edited script.txt
(the file where your ducky script goes) to your liking, let's run the image so it can generate the Arduino code.
KB_TYPE
= keyboard layout. Possible options are:be
,br
,ca
,ch
,cs
,de
,dk
,es
,fi
,fr
,gb
,hr
,it
,no
,pt
,ru
,si
,sv
,tr
,us
Linux/macOS:
$ docker run --rm -it -v $(pwd):/app -e KB_TYPE=us suce/ducky2spark
Windows:
$ docker run --rm -it -v %CD%:/app -e KB_TYPE=us suce/ducky2spark
Once finished, in the current folder, you will be presented with a sketch.ino
file that you can then load into Arduino and upload to your Digispark.