1
0
Fork 0

Add script to generate images

This commit is contained in:
Andrew Tomaka 2024-06-06 19:31:02 -04:00
parent 76036dbf67
commit 58e6d85d39
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
3 changed files with 39 additions and 0 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
all.svg
default.*
layer_*.*

8
README.md Normal file
View file

@ -0,0 +1,8 @@
# keyboard-layer-display
## create-images dependencies
* qmk_firmware
* keymap
* https://github.com/caksoylar/keymap-drawer
* rscg-convert

28
create-images Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env bash
rm -rf /tmp/keyboard
mkdir /tmp/keyboard
cp ~/Source/qmk_firmware/keyboards/crkbd/rev1/keyboard.json /tmp/keyboard/
qmk c2json --keyboard crkbd --keymap atomaka > /tmp/keyboard/layout.json
~/.local/bin/keymap parse -q /tmp/keyboard/layout.json > /tmp/keyboard/layout.yaml
~/.local/bin/keymap draw -j /tmp/keyboard/keyboard.json -l LAYOUT_split_3x6_3 /tmp/keyboard/layout.yaml > all.svg
~/.local/bin/keymap draw -s L0 -j /tmp/keyboard/keyboard.json -l LAYOUT_split_3x6_3 /tmp/keyboard/layout.yaml > default.svg
~/.local/bin/keymap draw -s L1 -j /tmp/keyboard/keyboard.json -l LAYOUT_split_3x6_3 /tmp/keyboard/layout.yaml > layer_1.svg
~/.local/bin/keymap draw -s L2 -j /tmp/keyboard/keyboard.json -l LAYOUT_split_3x6_3 /tmp/keyboard/layout.yaml > layer_2.svg
~/.local/bin/keymap draw -s L3 -j /tmp/keyboard/keyboard.json -l LAYOUT_split_3x6_3 /tmp/keyboard/layout.yaml > layer_3.svg
rsvg-convert -h 273 default.svg > default.png
rsvg-convert -h 273 layer_1.svg > layer_1.png
rsvg-convert -h 273 layer_2.svg > layer_2.png
rsvg-convert -h 273 layer_3.svg > layer_3.png
cp default.png "/Users/atomaka/Library/Application Support/keyboard-layer-display/layers/"
cp layer_*.png "/Users/atomaka/Library/Application Support/keyboard-layer-display/layers/"
if [ -z $1 ]; then
rm all.svg
rm default.*
rm layer_*.*
fi