Compare commits

..

No commits in common. "master" and "qmk" have entirely different histories.

28 changed files with 217 additions and 116 deletions

6
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "vial-qmk"]
path = vial-qmk
url = git@github.com:vial-kb/vial-qmk.git
[submodule "qmk_firmware"]
path = qmk_firmware
url = git@github.com:qmk/qmk_firmware.git

View file

@ -1,7 +1,7 @@
# Flashing the keyboard:
# make flash
qmk_dir = vial-qmk
qmk_dir = qmk_firmware
keyboard = handwired/dactyl_manuform/5x6
keymap = oddkb
@ -24,3 +24,21 @@ flash:
@make keymap_copy
@make qmk_flash
@make keymap_clean
# Creating layer previews:
# make preview[_copy] [layer=number]
layer = -1
preview_cmd = node \
./preview_generator/preview_generator.js \
"${PWD}/keymap/keymap.c" \
"$(layer)"
preview:
@${preview_cmd}
preview_copy:
@${preview_cmd} | xclip -sel clipboard
@echo 'The layout has been copied to the clipboard!'
@echo 'Paste it into the "Raw Data" tab here:'
@echo 'http://www.keyboard-layout-editor.com/'

View file

@ -3,53 +3,26 @@ My personal [Dactyl-ManuForm](https://github.com/abstracthat/dactyl-manuform). T
![overview](/images/photos/overview.jpg?raw=true)
## Current Layout
Current layout can be found in `layouts/current.vil`.
You can edit and apply it with [Vial](https://get.vial.today/).
## Layout
<details>
<summary>Layer 0 [qwerty]</summary>
![qwerty layer](/images/layers/current/layer-0-qwerty.png?raw=true)
![qwerty layer](/images/layers/layer-0-qwerty.png?raw=true)
</details>
<details>
<summary>Layer 1 [navigation]</summary>
![navigation layer](/images/layers/current/layer-1-nav.png?raw=true)
![qwerty layer](/images/layers/layer-1-nav.png?raw=true)
</details>
<details>
<summary>Layer 2 [mouse]</summary>
![mouse layer](/images/layers/current/layer-2-mouse.png?raw=true)
</details>
## Initial Layout
<details>
<summary>Layer 0 [qwerty]</summary>
![qwerty layer](/images/layers/initial/layer-0-qwerty.png?raw=true)
</details>
<details>
<summary>Layer 1 [navigation]</summary>
![navigation layer](/images/layers/initial/layer-1-nav.png?raw=true)
</details>
<details>
<summary>Layer 2 [mouse]</summary>
![mouse layer](/images/layers/initial/layer-2-mouse.png?raw=true)
![qwerty layer](/images/layers/layer-2-mouse.png?raw=true)
</details>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

View file

@ -1,20 +0,0 @@
#!/bin/bash
# GIMP commands for the screenshot preparation:
# - Layer > Crop to Content [Alt + L, O, O, Enter]
# - Image > Fit Canvas to Layers [Alt + I, A]
filename="$1"
bordercolor="#424242"
bordersize=16
if [ ! -f "$filename" ]; then
echo "Error: File not found: $filename"
exit 1
fi
magick \
"$filename" \
-bordercolor "$bordercolor" \
-border "${bordersize}x${bordersize}" \
"$filename"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -13,28 +13,12 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define USE_SERIAL
#define MASTER_LEFT
#define SPLIT_USB_DETECT
#define SPLIT_USB_TIMEOUT 2500
#define PERMISSIVE_HOLD
#define TAPPING_TERM 500
#define VIAL_KEYBOARD_UID {0x8A, 0x86, 0x65, 0x9D, 0x13, 0xE1, 0xCB, 0x81}
/* Vial unlock */
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 }
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 }
/* Vial features */
#define DYNAMIC_KEYMAP_LAYER_COUNT 5
#define DYNAMIC_MACRO_SIZE 0
#define VIAL_KEY_OVERRIDE_ENTRIES 8
#define VIAL_TAP_DANCE_ENTRIES 8
#define VIAL_COMBO_ENTRIES 8

View file

@ -1,13 +0,0 @@
VIA_ENABLE = yes
VIAL_ENABLE = yes
LTO_ENABLE = yes # LTO makes the compiler work harder when optimizing your code
EXTRAKEY_ENABLE = yes # Audio control and System control
MOUSEKEY_ENABLE = yes # Mouse keys
QMK_SETTINGS = yes # Vial QMK-settings tab
COMBO_ENABLE = yes
DYNAMIC_MACRO_ENABLE = no
KEY_OVERRIDE_ENABLE = no
TAP_DANCE_ENABLE = no

View file

@ -1,28 +0,0 @@
{
"name": "Dactyl Manuform (5x6)",
"lighting": "none",
"matrix": { "rows": 12, "cols": 6 },
"layouts": {
"keymap": [
["0,0", "0,1", "0,2", "0,3", "0,4", "0,5"],
["1,0", "1,1", "1,2", "1,3", "1,4", "1,5"],
["2,0", "2,1", "2,2", "2,3", "2,4", "2,5"],
["3,0", "3,1", "3,2", "3,3", "3,4", "3,5"],
[{ "x": 12, "y": -4 }, "6,0", "6,1", "6,2", "6,3", "6,4", "6,5"],
[{ "x": 12 }, "7,0", "7,1", "7,2", "7,3", "7,4", "7,5"],
[{ "x": 12 }, "8,0", "8,1", "8,2", "8,3", "8,4", "8,5"],
[{ "x": 12 }, "9,0", "9,1", "9,2", "9,3", "9,4", "9,5"],
[{ "x": 2 }, "4,2", "4,3"],
[{ "x": 4 }, "4,4", "4,5"],
[{ "x": 6 }, "5,4", "5,5"],
[{ "x": 6 }, "5,2", "5,3"],
[{ "x": 14, "y": -4 }, "10,2", "10,3"],
[{ "x": 12 }, "10,0", "10,1"],
[{ "x": 10 }, "11,0", "11,1"],
[{ "x": 10 }, "11,2", "11,3"]
]
}
}

View file

@ -1 +0,0 @@
{"version": 1, "uid": 9352816525526271626, "layout": [[["KC_GRAVE", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5"], ["KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T"], ["KC_BSLASH", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G"], ["KC_LSHIFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B"], [-1, -1, "OSM(MOD_LCTL)", "OSM(MOD_LALT)", "KC_ESCAPE", "KC_SPACE"], [-1, -1, "KC_LCTRL", "OSM(MOD_LGUI)", "KC_LALT", "MO(1)"], ["KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_RBRACKET"], ["KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRACKET"], ["KC_H", "KC_J", "KC_K", "KC_L", "KC_SCOLON", "KC_QUOTE"], ["KC_N", "KC_M", "KC_COMMA", "KC_DOT", "KC_SLASH", "KC_RSHIFT"], ["KC_ENTER", "KC_BSPACE", "KC_MINUS", "KC_EQUAL", -1, -1], ["MO(1)", "KC_RALT", "OSM(MOD_RGUI)", "KC_RCTRL", -1, -1]], [["KC_MUTE", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5"], ["KC_VOLU", "OSM(MOD_LALT)", "KC_NO", "KC_UP", "KC_NO", "KC_NO"], ["KC_VOLD", "OSM(MOD_LCTL)", "KC_LEFT", "KC_DOWN", "KC_RIGHT", "KC_CAPSLOCK"], ["KC_LSHIFT", "OSM(MOD_LSFT)", "LSFT(KC_COMMA)", "LSFT(KC_LBRACKET)", "KC_LBRACKET", "LSFT(KC_9)"], [-1, -1, "KC_F13", "KC_PSCREEN", "KC_TRNS", "KC_TRNS"], [-1, -1, "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11"], ["KC_HOME", "KC_PGDOWN", "KC_PGUP", "KC_END", "OSM(MOD_RALT)", "KC_F12"], ["KC_LEFT", "KC_DOWN", "KC_UP", "KC_RIGHT", "OSM(MOD_RCTL)", "KC_INSERT"], ["LSFT(KC_0)", "KC_RBRACKET", "LSFT(KC_RBRACKET)", "LSFT(KC_DOT)", "OSM(MOD_RSFT)", "KC_RSHIFT"], ["MO(2)", "KC_DELETE", "KC_APPLICATION", "KC_NO", -1, -1], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", -1, -1]], [["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_MS_U", "KC_NO", "KC_WH_U"], ["KC_NO", "KC_NO", "KC_MS_L", "KC_MS_D", "KC_MS_R", "KC_WH_D"], ["KC_LSHIFT", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], [-1, -1, "KC_NO", "KC_NO", "KC_ESCAPE", "KC_SPACE"], [-1, -1, "KC_LCTRL", "KC_LGUI", "KC_LALT", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_WH_U", "KC_ACL2", "KC_ACL0", "KC_ACL1", "KC_NO", "KC_NO"], ["KC_WH_D", "KC_BTN1", "KC_BTN2", "KC_BTN3", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", -1, -1], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", -1, -1]], [["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], [-1, -1, "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], [-1, -1, "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", -1, -1], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", -1, -1]], [["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], [-1, -1, "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], [-1, -1, "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS"], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", -1, -1], ["KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", -1, -1]]], "encoder_layout": [[], [], [], [], []], "layout_options": -1, "macro": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], "vial_protocol": 6, "via_protocol": 9, "tap_dance": [], "combo": [["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"], ["KC_NO", "KC_NO", "KC_NO", "KC_NO", "KC_NO"]], "key_override": [], "settings": {"1": 0, "2": 50, "3": 0, "4": 175, "5": 5, "6": 5000, "7": 500, "8": 0, "9": 0, "10": 10, "11": 3, "12": 7, "13": 60, "14": 0, "15": 80, "16": 0, "17": 400, "18": 0, "19": 80, "20": 5, "21": 0}}

View file

@ -0,0 +1,119 @@
const legends = {
'NO': '',
'TRNS': '▽',
'MO(1': 'FN1',
'MO(2': 'Mouse\nmode',
'GRV': '~\n`',
'1': '!\n1',
'2': '@\n2',
'3': '#\n3',
'4': '$\n4',
'5': '%\n5',
'6': '^\n6',
'7': '&\n7',
'8': '*\n8',
'9': '(\n9',
'0': ')\n0',
'MINS': '_\n',
'EQL': '+\n=',
'SLSH': '?\n/',
'BSLS': '|\n\\',
'LBRC': '{\n[',
'RBRC': '}\n]',
'SCLN': ':\n;',
'QUOT': '"\n\'',
'COMM': '<\n,',
'DOT': '>\n.',
'GT': '>',
'LT': '<',
'LPRN': '(',
'RPRN': ')',
'LCBR': '{',
'RCBR': '}',
'PLUS': '+',
'PMNS': '',
'PAST': '*',
'PSLS': '/',
'PEQL': '=',
'UNDS': '_',
'ESC': 'Esc',
'ENT': 'Enter',
'SPC': 'Space',
'BSPC': 'Back\nSpace',
'TAB': 'Tab',
'CAPS': 'Caps\nLock',
'LCTL': 'Ctrl',
'RCTL': 'Ctrl',
'LALT': 'Alt',
'RALT': 'Alt',
'LSFT': 'Shift',
'RSFT': 'Shift',
'LGUI': 'OS',
'RGUI': 'OS',
'LCTL_T(ESC': 'Ctrl\nEsc',
'RCTL_T(ESC': 'Ctrl\nEsc',
'OSM(MOD_LCTL': 'OSM\nCtrl',
'OSM(MOD_LALT': 'OSM\nAlt',
'OSM(MOD_LGUI': 'OSM\nOS',
'OSM(MOD_RGUI': 'OSM\nOS',
'HOME': 'Home',
'INS': 'Insert',
'DEL': 'Delete',
'END': 'End',
'PGDN': 'PgDn',
'PGUP': 'PgUp',
'PAUS': 'Pause',
'PSCR': 'PrScr',
'SYRQ': 'SysRq',
'APP': 'Menu',
'LEFT': 'Left',
'DOWN': 'Down',
'RGHT': 'Right',
'UP': 'Up',
'MUTE': 'Mute',
'VOLD': 'Vol ',
'VOLU': 'Vol +',
'ACL0': 'Slow',
'ACL1': 'Usual',
'ACL2': 'Fast',
'BTN1': 'Click',
'BTN2': 'Mouse\n2',
'BTN3': 'Mouse\n3',
'BTN4': 'Mouse\n4',
'BTN5': 'Mouse\n5',
'MS_D': 'Mouse\nDown',
'MS_L': 'Mouse\nLeft',
'MS_R': 'Mouse\nRight',
'MS_U': 'Mouse\nUp',
'WH_D': 'Wheel\ndown',
'WH_U': 'Wheel\nup',
}
const cleanKeys = keys => keys
.map(key => key
.replaceAll(')', '')
.trim())
.filter(Boolean)
const printLegends = keys => keys
.map(key => key.replace('KC_', ''))
.map(key => legends[key] ?? key)
.map(key => [{a: key.includes('\n')
? 5 // 2 lines
: 3 // 1 line
}, key])
module.exports = {
cleanKeys,
printLegends
}

View file

@ -0,0 +1,37 @@
const HALVES_GAP = 5
const NUMBER_OF_ROWS = 8
const row = (keys, start, gapOffset) => [
{x: start},
...keys.slice(0, keys.length / 2),
{x: HALVES_GAP + gapOffset},
...keys.slice(keys.length / 2),
].flat()
const row12 = keys =>
row(keys, 0, 0)
const row4 = (keys, rowIndex) => ({
4: row(keys, 2, 4),
5: row(keys, 4, 0),
6: row(keys, 6, -4),
7: row(keys, 6, -4),
}[rowIndex % NUMBER_OF_ROWS])
const buildRow = (keys, rowIndex) => ({
12: row12(keys),
4: row4(keys, rowIndex)
}[keys.length] || ['Oh no...'])
const layerRange = layerIndex =>
layerIndex === -1
? []
: Array(2)
.fill(layerIndex)
.map((x, i) => x + i)
.map(x => x * NUMBER_OF_ROWS)
module.exports = {
layerRange,
buildRow
}

View file

@ -0,0 +1,32 @@
/**
* Convert the keymap.c file to the "Raw data" for
* http://www.keyboard-layout-editor.com/
*/
const fs = require('fs')
const {buildRow, layerRange} = require('./parts/rows')
const {cleanKeys, printLegends} = require('./parts/keys')
const keymapToKLERawData = (fileContent, layerIndex) =>
fileContent
.split('\n')
.map(row => row.split(','))
.filter(keys => keys.length > 1)
.slice(...layerRange(layerIndex))
.map(cleanKeys)
.map(printLegends)
.map(buildRow)
.map(JSON.stringify)
.join(',\n')
/* */
const keymapFilePath = process.argv[2]
const layerIndex = Number(process.argv[3])
const fileContent = fs.readFileSync(keymapFilePath, 'utf8')
const rawData = keymapToKLERawData(fileContent, layerIndex)
console.log(rawData)

1
qmk_firmware Submodule

@ -0,0 +1 @@
Subproject commit 37b62606cec1cce42b4c1c0035c72bc021f549d8

@ -1 +0,0 @@
Subproject commit b1f7f46af8457907afa17aaf9f887ed43c679f92