-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup
executable file
·80 lines (67 loc) · 2.29 KB
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
# Running ./setup creates links in the
# qmk_firmware directory keymaps or keyboards
# folders so that we can keep custom keymaps/boards
# under separate version control, while pulling changes
# from QMK itself.
#
# Build via-enabled basic hwcrkbd with:
# qmk compile -kb hwcrkbd/rev1 -km bsag-via
# or for my custom keymap, no via:
# qmk compile -kb hwcrkbd/rev1 -km bsag
#
# Ferris-emulating keymap for 3x6 crkbd
# qmk compile -kb crkbd/rev1 -km mini3x6
#
# Actual keymap for 3x5 ferris sweep
# qmk compile -kb ferris/sweep -km mini3x5
MY_HOME=`echo $HOME`
QMK_HOME="$MY_HOME/git/github/qmk_firmware"
# Gets the full path to this keymaps repo's directory
REPO_DIR="$(realpath "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )")"
function symlink_hwcrkbd_custom_keyboard() {
local source_keymap="$REPO_DIR/hwcrkbd"
local symlink_destination="$QMK_HOME/keyboards/hwcrkbd"
if [ ! -d "$symlink_destination" ]; then
echo "Symlinking keyboard"
ln -s "$source_keymap" "$symlink_destination"
else
echo "Keyboard already in place, nothing to do"
fi
}
function symlink_totem_custom_keyboard() {
local source_keymap="$REPO_DIR/totem"
local symlink_destination="$QMK_HOME/keyboards/totem"
if [ ! -d "$symlink_destination" ]; then
echo "Symlinking keyboard"
ln -s "$source_keymap" "$symlink_destination"
else
echo "Keyboard already in place, nothing to do"
fi
}
function symlink_mini3x6_custom_keymap() {
local source_keymap="$REPO_DIR/mini3x6"
local symlink_destination="$QMK_HOME/keyboards/crkbd/keymaps/mini3x6"
if [ ! -d "$symlink_destination" ]; then
echo "Symlinking crkbd 3x6 keymap"
ln -s "$source_keymap" "$symlink_destination"
else
echo "Keymap already in place, nothing to do"
fi
}
function symlink_mini3x5_custom_keymap() {
local source_keymap="$REPO_DIR/mini3x5"
local symlink_destination="$QMK_HOME/keyboards/ferris/keymaps/mini3x5"
if [ ! -d "$symlink_destination" ]; then
echo "Symlinking Ferris mini3x5 keymap"
ln -s "$source_keymap" "$symlink_destination"
else
echo "Keymap already in place, nothing to do"
fi
}
symlink_hwcrkbd_custom_keyboard
symlink_totem_custom_keyboard
symlink_mini3x6_custom_keymap
symlink_mini3x5_custom_keymap
# build firmware like so:
# qmk compile -kb totem -km default