Skip to content

Commit

Permalink
refactor: use gnu stow to manage qmk symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Oct 31, 2023
1 parent c39839c commit 62e6fe0
Show file tree
Hide file tree
Showing 53 changed files with 250 additions and 27 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
just
keymap-drawer
qmk
stow
watchexec
];

Expand Down
35 changes: 8 additions & 27 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ alias f := flash
alias l := layout
alias w := watch-layout

stow:
stow -d {{justfile_directory()}}/qmk -t {{justfile_directory()}}/firmware .

# Build all keyboards
all:
@just dm4
Expand Down Expand Up @@ -111,40 +114,18 @@ right keyboard:
# Setup submodule and link directories to submodules
init:
#!/usr/bin/env bash
git config submodule.firmware.ignore all
git submodule update --init --recursive --recommend-shallow
if [ ! -L "{{user_symlink}}" ] ; then
ln -sf $(pwd)/user {{user_symlink}}
fi
if [ ! -L "{{dm4_symlink}}" ] ; then
ln -sf $(pwd)/keyboard/dm/4x6 {{dm4_symlink}}
fi
if [ ! -L "{{dm5_symlink}}" ] ; then
ln -sf $(pwd)/keyboard/dm/5x6 {{dm5_symlink}}
fi
if [ ! -L "{{crkbd_symlink}}" ] ; then
ln -sf $(pwd)/keyboard/crkbd {{crkbd_symlink}}
fi
if [ ! -L "{{tofu_symlink}}" ] ; then
ln -sf $(pwd)/keyboard/tofu {{tofu_symlink}}
stow -d {{justfile_directory()}}/qmk -t {{justfile_directory()}}/firmware .
if [ $(git config submodule.firmware.ignore) != "all" ]; then
git config submodule.firmware.ignore all
fi
if [ "$(qmk config user.qmk_home | cut -d '=' -f 2)" != "{{justfile_directory()}}/firmware" ]; then
qmk config user.qmk_home="{{justfile_directory()}}/firmware"
fi
# Re-initialize symlinks
reinit:
#!/usr/bin/env bash
rm -rf {{user_symlink}}
rm -rf {{dm4_symlink}}
rm -rf {{dm5_symlink}}
rm -rf {{crkbd_symlink}}
rm -rf {{tofu_symlink}}
just init
# Format c files
fmt:
clang-format --style=llvm -i $(fd --exclude firmware --exclude user/features --extension c --extension h .)
clang-format --style=llvm -i $(fd --exclude firmware --exclude qmk/users/edeneast/features --extension c --extension h .)

# Generate layout map
layout:
Expand Down Expand Up @@ -176,7 +157,7 @@ qmk-update:
git submodule update --init --recursive --recommend-shallow
popd
git add -f ./firmware
just reinit
just init
# Update features subtree
subtree-update:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
112 changes: 112 additions & 0 deletions qmk/keyboards/handwired/dactyl_manuform/4x6/via.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"name": "Dactyl Manuform 4x6",
"vendorId": "0x444D",
"productId": "0x3436",
"matrix": {
"rows": 10,
"cols": 6
},
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2",
"0,3",
"0,4",
"0,5",
{
"x": 3.5
},
"5,0",
"5,1",
"5,2",
"5,3",
"5,4",
"5,5"
],
[
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
"1,5",
{
"x": 3.5
},
"6,0",
"6,1",
"6,2",
"6,3",
"6,4",
"6,5"
],
[
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
"2,5",
{
"x": 3.5
},
"7,0",
"7,1",
"7,2",
"7,3",
"7,4",
"7,5"
],
[
{
"x": 2
},
"3,2",
"3,3",
{
"x": 7.5
},
"8,2",
"8,3"
],
[
{
"x": 4
},
"3,4",
"3,5",
{
"x": 3.5
},
"8,0",
"8,1"
],
[
{
"x": 5
},
"4,4",
"4,5",
{
"x": 1.5
},
"9,0",
"9,1"
],
[
{
"x": 5
},
"4,2",
"4,3",
{
"x": 1.5
},
"9,2",
"9,3"
]
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
129 changes: 129 additions & 0 deletions qmk/keyboards/handwired/dactyl_manuform/5x6/via.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"name": "Dactyl Manuform 5x6",
"vendorId": "0x444D",
"productId": "0x3436",
"matrix": {
"rows": 12,
"cols": 6
},
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2",
"0,3",
"0,4",
"0,5",
{
"x": 3.5
},
"6,0",
"6,1",
"6,2",
"6,3",
"6,4",
"6,5"
],
[
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
"1,5",
{
"x": 3.5
},
"7,0",
"7,1",
"7,2",
"7,3",
"7,4",
"7,5"
],
[
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
"2,5",
{
"x": 3.5
},
"8,0",
"8,1",
"8,2",
"8,3",
"8,4",
"8,5"
],
[
"3,0",
"3,1",
"3,2",
"3,3",
"3,4",
"3,5",
{
"x": 3.5
},
"9,0",
"9,1",
"9,2",
"9,3",
"9,4",
"9,5"
],
[
{
"x": 2
},
"4,2",
"4,3",
{
"x": 7.5
},
"10,2",
"10,3"
],
[
{
"x": 4
},
"4,4",
"4,5",
{
"x": 3.5
},
"10,0",
"10,1"
],
[
{
"x": 5
},
"5,4",
"5,5",
{
"x": 1.5
},
"11,0",
"11,1"
],
[
{
"x": 5
},
"5,2",
"5,3",
{
"x": 1.5
},
"11,2",
"11,3"
]
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 62e6fe0

Please sign in to comment.