Skip to content

Vlender icon

Vlender

Vlender is a blender for Vial. It is a little app that takes an input keymap file (.vil) and blends the Combos and Tap Dances into another keymap file. The idea is that you can transfer these features to another keyboard (with another layout) without adding them all by hand.

The app only works on macOS, but further down you can find the script and tool I used, so you can recreate it on your preferred OS.

Note

I am not a programmer and just threw this together with the help of Platybus. Its basically a script using jq with a nice wrapper.

Background

I really like Vial but it also has some drawbacks. Because of how it works certain features can not be configured through the QMK keymap. So they can not be easily copied or synced from one Keyboard to another. These features are

  • Combos
  • Tap Dance
  • Key Overrides

This App/script takes these three features and overrides these in the Vial-keymap-file (.vil) you drop on it. All other settings will not be changed.

Note

If your source keymap has more for example combos than the target keymap/keyboard, they will still be all written to the keymap-file. During import Vial will ignore the last ones that can not fit.

Download

Vlender 1.0 - 08.05.2024

Use

  1. Download and extract the app and put it in an empty folder of your choice. (Should be empty just for less clutter while using)
  2. Save/copy your source keymap (with all the combos etc) from Vial into this folder. Rename it input.vil (This is mandatory, otherwise it wont work).
  3. Save/copy the keymap of the target keyboard to this folder.
  4. Drag the target keymap on the Vlender app. You can also just start it, then there will be a drag-target. It will create a new file named *_vlendered.vil with your keymap + the combos etc from the source keymap (input.vil)

How does it work

It uses the excellent command line tool jq to work with the keymap files, they are json files. Since it is normally not installed, it is bundled into the app. Other than that, its only this script:

#!/bin/zsh
parent_folder="$(dirname "$1")" //gets the path to the folder the keymap file is in
original_filename=$(basename "$1") //gets the filename of the keymap file
filename_no_extension="${original_filename%.*}" // puts just the name of the file without extension into a variable
new_output_filename="${filename_no_extension}_vlendered.vil"  //adds _vlendered to the file output file name
./jq '.combo = input.combo' $1 "$parent_folder/input.vil" > "$parent_folder/temp1.json" //copies the combos to temp1
./jq '.key_override = input.key_override' "$parent_folder/temp1.json" "$parent_folder/input.vil" > "$parent_folder/temp2.json" //uses temp1 and copies the key overrides in there and writes it to temp2
./jq '.tap_dance = input.tap_dance' "$parent_folder/temp2.json" "$parent_folder/input.vil" > "$parent_folder/$new_output_filename" //uses temp2 and copies the Tap Dance in there and writes it to the final file name
rm "$parent_folder/temp1.json" //removes the temp files
rm "$parent_folder/temp2.json"

You can right click on the app and click "show package contents" and there is under Contents/Ressources you can look into the "script" file. Its all there.

I dont want to use your app

Thats fine

On the Mac you can just brew install jq (if you hopefully already use homebrew) and use the commands from above.

On Linux its most probably the same with your package manager of choice.

On Windows: I dont know about command line stuff on windows. There be dragons.