Skip to content

Repository files navigation

💀 🦆 📝 dead-duck-conf

YAML-based configuration-as-code for (OG) duckyPad devices.

Table of Contents

DISCLAIMER

Warning

This repository/application is not part of the official "duckyPad" ecosystem/toolset.

Motivation

Unfortunately the official (and recently updated) duckyPad config app ("duckyPad-Configurator") does not work on my system.
The "legacy configuration app" also doesn't work any longer; regardless of the device's firmware version.

There seem to be general communication problems between the device and the (Linux-)OS (see issue #3).

Not being able to update/change the duckyPad's key-config would - in the long run - result in an unusable and dead device.

I ❤️ my duckyPad.
It's a wonderful (open source) device, which served me well for several years.

So, in order to update my key configuration, I needed a different approach.

Changing/updating the configuration data (stored on the device's SD card) via a simple text editor is no option.
That's mainly because the duckyPad's configuration data consists of several binary files, which contain the actual "duckyPad script commands".

So this app will provide an alternative way to configure the duckyPad by generating the necessary (binary) config files via a simple/editable YAML structure.

Concept

A YAML file like this ...

settings:
  sleep_after_min: 9

profiles:

  #########################
  ### profile "welcome" ...

  - name: welcome

    bg_color:
      r: 128
      g: 0
      b: 255

    keys:

      ### row 1 ...

      - name: file
        script_code: WINDOWS e
        sw_color:
          r: 0
          g: 0
          b: 255

      - unassigned

      - name: hello
        script_code: |-
          OLED_CLEAR
          
          OLED_CURSOR 20 10
          OLED_PRINT Hello World!
          
          OLED_UPDATE
        sw_color:
          r: 255
          g: 0
          b: 0

  ########################
  ### profile "numpad" ...

  - name: numpad

    bg_color:
      r: 128
      g: 0
      b: 255

    keys:

      ### row 1 ...

      - name: "numLK"
        script_code: NUMLOCK
        sw_color:
          r: 0
          g: 255
          b: 0

      - name: "-"
        script_code: KP_MINUS
        sw_color:
          r: 0
          g: 255
          b: 255

      - name: "+"
        script_code: KP_PLUS
        sw_color:
          r: 0
          g: 255
          b: 255

      ### row 2 ...

      - name: "7"
        script_code: KP_7

# ...

... will generate the according duckyPad configuration files:

.
└── out
    ├── dp_settings.txt
    ├── profile1_welcome
    │   ├── config.txt
    │   ├── key1.dsb
    │   ├── key1.txt
    │   ├── key3.dsb
    │   └── key3.txt
    └── profile2_numpad
        ├── config.txt
        ├── key10.dsb
        ├── key10.txt
        ├── key11.dsb
        ├── key11.txt
        ├── key12.dsb
        ├── key12.txt
        ├── key13.dsb
        ├── key13.txt
        ├── key14.dsb
        ├── key14.txt
        ├── key15.dsb
        ├── key15.txt
        ├── key1.dsb
        ├── key1.txt
        ├── key2.dsb
        ├── key2.txt
        ├── key3.dsb
        ├── key3.txt
        ├── key4.dsb
        ├── key4.txt
        ├── key5.dsb
        ├── key5.txt
        ├── key6.dsb
        ├── key6.txt
        ├── key7.dsb
        ├── key7.txt
        ├── key8.dsb
        ├── key8.txt
        ├── key9.dsb
        └── key9.txt

All files/directories in the out-folder can directly be used and copied to the root of your duckyPad SD card.

Check the config.yaml file for a full example.
(A detailed definition for the YAML structure can be found here: ConfigModel)

Usage

Warning

The generated config files will only work with firmware 1.3.3!

Make sure you flash this firmware onto your device: duckypad_v1.3.3.dfu

Python

Run dead-duck-conf via your local Python installation:

git clone https://github.com/4ch1m/dead-duck-conf.git
cd dead-duck-conf
git submodule update --init

python3 -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt

python -m dead_duck_conf.main

Docker

Run dead-duck-conf using Docker:

docker run \
  -it \
  --rm \
  -v ./config.yaml:/dead-duck-conf/config.yaml \
  -v ./out:/dead-duck-conf/out \
  4ch1m/dead-duck-conf:latest

License

Please read the LICENSE file.

About

YAML-based configuration-as-code for (OG) duckyPad devices.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages