diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 353692db77..54e04fa9c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest container: image: zmkfirmware/zmk-build-arm:stable - name: Build + name: Build (Legacy) steps: - name: Checkout uses: actions/checkout@v4 @@ -55,7 +55,63 @@ jobs: - name: Archive (Adv360) uses: actions/upload-artifact@v4 with: - name: firmware + name: firmware-no-clique path: | ${{ steps.get_info.outputs.file_prefix }}-left.uf2 ${{ steps.get_info.outputs.file_prefix }}-right.uf2 + build-clique: + runs-on: ubuntu-latest + container: + image: zmkfirmware/zmk-build-arm:stable + name: Build (Clique) + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get version data + id: get_info + run: | + timestamp=$(date +"%Y%m%d%H%M") + commit=$(echo "${{ github.sha }}" | cut -c1-7) + file_prefix=$timestamp-$commit + branch_name=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}' | cut -c1-4) + echo "file_prefix=$file_prefix" >> $GITHUB_OUTPUT + bin/get_version.sh $branch_name $commit clique + - name: Cache west modules + uses: actions/cache@v4 + env: + cache-name: cache-zephyr-modules + with: + path: | + modules/ + tools/ + zephyr/ + bootloader/ + zmk/ + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: West Init + run: west init -l config + - name: West Update + run: west update + - name: West Zephyr export + run: west zephyr-export + - name: West Build (left) + run: west build -s zmk/app -d build/left -b adv360_left -S studio-rpc-usb-uart -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config -DCONFIG_ZMK_STUDIO=y" + - name: Adv360 Left Kconfig file + run: grep -vE '(^#|^$)' build/left/zephyr/.config + - name: West Build (right) + run: west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" + - name: Adv360 Right Kconfig file + run: grep -vE '(^#|^$)' build/right/zephyr/.config + - name: Rename zmk.uf2 + run: cp build/left/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-left.uf2 && cp build/right/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-right.uf2 + - name: Archive (Adv360) + uses: actions/upload-artifact@v4 + with: + name: firmware-clique + path: | + ${{ steps.get_info.outputs.file_prefix }}-left.uf2 + ${{ steps.get_info.outputs.file_prefix }}-right.uf2 \ No newline at end of file diff --git a/bin/get_version.sh b/bin/get_version.sh index aa23e1719d..511315d338 100755 --- a/bin/get_version.sh +++ b/bin/get_version.sh @@ -4,6 +4,7 @@ date=$(date -u +"%Y%m%d") branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)} commit=${2:-$(git rev-parse --short HEAD)} +clique=${3:-"."} uppercase_char() { local char=$1 @@ -48,8 +49,16 @@ for ((i = 0; i < ${#commit}; i++)); do formatted_commit+=$(transform_char "${commit:$i:1}") done +formatted_commit+="<&kp MINUS>, " + +# Iterate over the clique string and format characters +formatted_clique="" +for ((i = 0; i < ${#clique}; i++)); do + formatted_clique+=$(transform_char "${commit:$i:1}") +done + # Combine the formatted string, add trailing carriage return -formatted_result="$formatted_date$formatted_branch$formatted_commit" +formatted_result="$formatted_date$formatted_branch$formatted_commit$formatted_clique" formatted_result+="<&kp RET>" echo $formatted_result @@ -58,7 +67,7 @@ echo $formatted_result echo '#define VERSION_MACRO' > "config/version.dtsi" echo 'macro_ver: macro_ver {' >> "config/version.dtsi" echo 'compatible = "zmk,behavior-macro";' >> "config/version.dtsi" -echo 'label = "macro_ver";' >> "config/version.dtsi" +echo 'display-name = "Version Macro";' >> "config/version.dtsi" echo '#binding-cells = <0>;' >> "config/version.dtsi" echo "bindings = $formatted_result;" >> "config/version.dtsi" echo '};' >> "config/version.dtsi" diff --git a/config/adv360.keymap b/config/adv360.keymap index cf80f15e8e..4f2515cb1f 100644 --- a/config/adv360.keymap +++ b/config/adv360.keymap @@ -35,9 +35,9 @@ bindings = < &kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT + &kp ESC &kp A &kp S &kp D &kp F &kp G &none &studio_unlock &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT - &mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2 + &mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT ¯o_ver &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2 >; }; keypad { diff --git a/config/boards/arm/adv360/adv360-layouts.dtsi b/config/boards/arm/adv360/adv360-layouts.dtsi new file mode 100644 index 0000000000..7970e1be3b --- /dev/null +++ b/config/boards/arm/adv360/adv360-layouts.dtsi @@ -0,0 +1,87 @@ +#include + +/ { + physical_layout0: physical_layout_0 { + compatible = "zmk,physical-layout"; + display-name = "Default"; + + keys // w h x y rot rx ry + = <&key_physical_attrs 125 100 0 25 0 0 0> + , <&key_physical_attrs 100 100 125 25 0 0 0> + , <&key_physical_attrs 100 100 225 0 0 0 0> + , <&key_physical_attrs 100 100 325 0 0 0 0> + , <&key_physical_attrs 100 100 425 0 0 0 0> + , <&key_physical_attrs 100 100 525 0 0 0 0> + , <&key_physical_attrs 100 100 625 0 0 0 0> + , <&key_physical_attrs 100 100 1075 0 0 0 0> + , <&key_physical_attrs 100 100 1175 0 0 0 0> + , <&key_physical_attrs 100 100 1275 0 0 0 0> + , <&key_physical_attrs 100 100 1375 0 0 0 0> + , <&key_physical_attrs 100 100 1475 0 0 0 0> + , <&key_physical_attrs 100 100 1575 25 0 0 0> + , <&key_physical_attrs 125 100 1675 25 0 0 0> + , <&key_physical_attrs 125 100 0 125 0 0 0> + , <&key_physical_attrs 100 100 125 125 0 0 0> + , <&key_physical_attrs 100 100 225 100 0 0 0> + , <&key_physical_attrs 100 100 325 100 0 0 0> + , <&key_physical_attrs 100 100 425 100 0 0 0> + , <&key_physical_attrs 100 100 525 100 0 0 0> + , <&key_physical_attrs 100 100 625 100 0 0 0> + , <&key_physical_attrs 100 100 1075 100 0 0 0> + , <&key_physical_attrs 100 100 1175 100 0 0 0> + , <&key_physical_attrs 100 100 1275 100 0 0 0> + , <&key_physical_attrs 100 100 1375 100 0 0 0> + , <&key_physical_attrs 100 100 1475 100 0 0 0> + , <&key_physical_attrs 100 100 1575 125 0 0 0> + , <&key_physical_attrs 125 100 1675 125 0 0 0> + , <&key_physical_attrs 125 100 0 225 0 0 0> + , <&key_physical_attrs 100 100 125 225 0 0 0> + , <&key_physical_attrs 100 100 225 200 0 0 0> + , <&key_physical_attrs 100 100 325 200 0 0 0> + , <&key_physical_attrs 100 100 425 200 0 0 0> + , <&key_physical_attrs 100 100 525 200 0 0 0> + , <&key_physical_attrs 100 100 625 200 0 0 0> + , <&key_physical_attrs 100 100 675 400 1500 525 400> + , <&key_physical_attrs 100 100 775 400 1500 525 400> + , <&key_physical_attrs 100 100 925 400 (-1500) 1275 400> + , <&key_physical_attrs 100 100 1025 400 (-1500) 1275 400> + , <&key_physical_attrs 100 100 1075 200 0 0 0> + , <&key_physical_attrs 100 100 1175 200 0 0 0> + , <&key_physical_attrs 100 100 1275 200 0 0 0> + , <&key_physical_attrs 100 100 1375 200 0 0 0> + , <&key_physical_attrs 100 100 1475 200 0 0 0> + , <&key_physical_attrs 100 100 1575 225 0 0 0> + , <&key_physical_attrs 125 100 1675 225 0 0 0> + , <&key_physical_attrs 125 100 0 325 0 0 0> + , <&key_physical_attrs 100 100 125 325 0 0 0> + , <&key_physical_attrs 100 100 225 300 0 0 0> + , <&key_physical_attrs 100 100 325 300 0 0 0> + , <&key_physical_attrs 100 100 425 300 0 0 0> + , <&key_physical_attrs 100 100 525 300 0 0 0> + , <&key_physical_attrs 100 100 775 500 1500 525 400> + , <&key_physical_attrs 100 100 925 500 (-1500) 1275 400> + , <&key_physical_attrs 100 100 1175 300 0 0 0> + , <&key_physical_attrs 100 100 1275 300 0 0 0> + , <&key_physical_attrs 100 100 1375 300 0 0 0> + , <&key_physical_attrs 100 100 1475 300 0 0 0> + , <&key_physical_attrs 100 100 1575 325 0 0 0> + , <&key_physical_attrs 125 100 1675 325 0 0 0> + , <&key_physical_attrs 125 100 0 425 0 0 0> + , <&key_physical_attrs 100 100 125 425 0 0 0> + , <&key_physical_attrs 100 100 225 400 0 0 0> + , <&key_physical_attrs 100 100 325 400 0 0 0> + , <&key_physical_attrs 100 100 425 400 0 0 0> + , <&key_physical_attrs 100 200 575 500 1500 525 400> + , <&key_physical_attrs 100 200 675 500 1500 525 400> + , <&key_physical_attrs 100 100 775 600 1500 525 400> + , <&key_physical_attrs 100 100 925 600 (-1500) 1275 400> + , <&key_physical_attrs 100 200 1025 500 (-1500) 1275 400> + , <&key_physical_attrs 100 200 1125 500 (-1500) 1275 400> + , <&key_physical_attrs 100 100 1275 400 0 0 0> + , <&key_physical_attrs 100 100 1375 400 0 0 0> + , <&key_physical_attrs 100 100 1475 400 0 0 0> + , <&key_physical_attrs 100 100 1575 425 0 0 0> + , <&key_physical_attrs 125 100 1675 425 0 0 0> + ; + }; +}; \ No newline at end of file diff --git a/config/boards/arm/adv360/adv360.dtsi b/config/boards/arm/adv360/adv360.dtsi index 0c85836f72..0245f56c7d 100644 --- a/config/boards/arm/adv360/adv360.dtsi +++ b/config/boards/arm/adv360/adv360.dtsi @@ -11,8 +11,13 @@ #include #include +#include "adv360-layouts.dtsi" #include "adv360_pinctrl.dtsi" +&physical_layout0 { + transform = <&matrix_transform0>; +}; + / { model = "Adv360"; compatible = "kinesis,adv360"; @@ -25,11 +30,11 @@ zmk,kscan = &kscan0; zmk,backlight = &backlight; zmk,battery = &vbatt; - zmk,matrix_transform = &default_transform; + zmk,physical-layout = &physical_layout0; zmk,underglow = &led_strip; }; - default_transform: keymap_transform_0 { + matrix_transform0: keymap_transform_0 { compatible = "zmk,matrix-transform"; columns = <20>; rows = <5>; diff --git a/config/boards/arm/adv360/adv360_left_defconfig b/config/boards/arm/adv360/adv360_left_defconfig index b37679a4d3..852621c0c4 100644 --- a/config/boards/arm/adv360/adv360_left_defconfig +++ b/config/boards/arm/adv360/adv360_left_defconfig @@ -71,4 +71,6 @@ CONFIG_ZMK_BLE_PASSKEY_ENTRY=n CONFIG_ZMK_BLE=y CONFIG_ZMK_USB=y -CONFIG_ZMK_HID_INDICATORS=y \ No newline at end of file +CONFIG_ZMK_HID_INDICATORS=y + +CONFIG_ZMK_BEHAVIOR_LOCAL_ID_TYPE_CRC16=y \ No newline at end of file diff --git a/config/boards/arm/adv360/adv360_right.dts b/config/boards/arm/adv360/adv360_right.dts index b7d96787e4..1c775401ee 100644 --- a/config/boards/arm/adv360/adv360_right.dts +++ b/config/boards/arm/adv360/adv360_right.dts @@ -38,6 +38,6 @@ }; }; -&default_transform { +&matrix_transform0 { col-offset = <10>; }; diff --git a/config/boards/arm/adv360/macros.dtsi b/config/boards/arm/adv360/macros.dtsi index 69f6c4f3ab..497d4fb541 100644 --- a/config/boards/arm/adv360/macros.dtsi +++ b/config/boards/arm/adv360/macros.dtsi @@ -34,3 +34,192 @@ #binding-cells = <0>; bindings = <&kp K>, <&kp I>, <&kp N>, <&kp E>, <&kp S>, <&kp I>, <&kp S>; }; + + Win_Cut: Windows_Cut { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(X)>; + display-name = "Windows Cut"; + }; + + Win_Copy: Windows_Copy { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(C)>; + display-name = "Windows Copy"; + }; + + Win_Paste: Windows_Paste { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(V)>; + display-name = "Windows Paste"; + }; + + Win_Select_All: Windows_SelectAll { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(A)>; + display-name = "Windows Select All"; + }; + + Win_Undo: Windows_Undo { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(Z)>; + display-name = "Windows Undo"; + }; + + Win_Desktop: Win_Desk { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(D)>; + display-name = "Windows Desktop"; + }; + + Win_File_Explorer: Win_Explr { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(E)>; + display-name = "Windows Explorer"; + }; + + Win_Snip_Tool: Win_Snip { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LS(LG(S))>; + display-name = "Windows Screen Snip"; + }; + + Win_Show_All_Windows: Win_ShowAW { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(TAB)>; + display-name = "Windows Show All Windows"; + }; + + Mac_Cut: Mac_Cut { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(X)>; + display-name = "Mac Cut"; + }; + + Mac_Copy: Mac_Copy { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(C)>; + display-name = "Mac Copy"; + }; + + Mac_Paste: Mac_Paste { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(V)>; + display-name = "Mac Paste"; + }; + + Mac_Undo: Mac_Undo { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(Z)>; + display-name = "Mac Undo"; + }; + + Mac_Select_All: Mac_SelAll { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(A)>; + display-name = "Mac Select All"; + }; + + Mac_Mission_Control: Mac_ShowAW { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(UP_ARROW)>; + display-name = "Mac Show All Windoes"; + }; + + Mac_Snip_Tool: Mac_Snip { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LC(LG(LS(NUMBER_4)))>; + display-name = "Mac Screen Snip"; + }; + + Win_Close_Program: Win_Close_Program { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LA(F4)>; + display-name = "Windows Close"; + }; + + Win_Settings_Menu: Win_Settings_Menu { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(I)>; + display-name = "Windows Settings"; + }; + + Win_Lock_PC: Win_Lock_PC { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(L)>; + display-name = "Windows Lock"; + }; + + Win_Tile_Left: Win_Tile_Left { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(LEFT)>; + display-name = "Windows Tile Left"; + }; + + Win_Tile_Up: Win_Tile_Up { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(UP_ARROW)>; + display-name = "Windows Tile Up"; + }; + + Win_Tile_Down: Win_Tile_Down { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(DOWN)>; + display-name = "Windows Tile Down"; + }; + + Win_Tile_Right: Win_Tile_Right { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(RIGHT)>; + display-name = "Windows Tile Right"; + }; + + Mac_Spotlight_Search: Mac_Spotlight_Search { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(SPACE)>; + display-name = "Mac Spotlight Search"; + }; + + Mac_Close_Program: Mac_Close_Program { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(Q)>; + display-name = "Mac Close Program"; + }; + + Mac_Strike_Through_Text: Mac_Strike_Through_Text { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&kp LG(LS(X))>; + display-name = "Mac Strikethrough Text"; + }; + + Double_Click: Double_Click { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <&mkp MB1 &mkp MB1>; + display-name = "Double Click"; + }; \ No newline at end of file