1
0
Fork 0
keyboard-layer-display/create-images

28 lines
1.3 KiB
Bash
Executable file

#!/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