Skip to content

Commit

Permalink
v0.19.0 (#117)
Browse files Browse the repository at this point in the history
* Add support for 2022 keyboards

* Move effects to separate files

* Pass the generated profile as-is

* Smooth wave code dedup

* Fix #78

* Update the cli code

* Update deps

* Unify the logic for distinguishing effects that take input colours

* Make speed reach beyond stock

* Append json extension when saving a profile

* Change wording from preset to profile

* (Hopefully) Reduce resource usage for Fade

* Allow custom fps for AmbientLight

Solves #71

* Remove restriction for Temperature on Windows

* Finishing touches for 0.18.0

* Fix cli speed cap

* Fix ambient not respecting fps setting

Also update its dependencies

* Nix build system

* Fix execution issues on nix build

* Kinda fix shell env

* Nuke gui code

* Rework the CLI

* Fix #98

* Clamp AmbientLight fps

* Move driver to its own crate

* Update hidapi

* Better error handlng

* Refactor the zone representation

* Test UI

* #96 and misc README changes

* Pass CLI instructions to the GUI

* UI Progress

* Probably final layout

* Allow starting the GUI hidden

* AmbientLight FPS control

* In-memory profile management

* Error modals

* Update flake.nix

* Remove custom effect (unused) speed

* AmbientLight stuffs

* Profile and effect load/save management

* Update mod.rs

* Update workflows

* Windows fixing

* Linux dep fixing

* Move GUI startup code to a separate function

* Cli fixes

* Fix speed range crash

* Switch to spaces

* Change highlight color

* Update version

* Update cli.rs

* Clippy

* Switch to upstream clap

* Ambientlight improvements

* Update workflows

* Update checking capabilities

* Clippy

* Fix typo in update check code

* Revert using run-vcpkg in workflows

* Fix speed range issue

* Less convoluted settings

* Update workflows

* Update readme

* Use rdev

* Update compile-rust.yml

* Update compile-rust.yml

* Misc cleanup

* Better Ripple

* Revert to libusb

* Feature parity with old UI

* Update workflows

* Re include libusb in workflows

* Update temperature.rs

* Fix CPU usage and first boot lights update

* Profile switching bounds check

* Remove useless impl from CustomEffectState

* Revert to device-query

* Fixes

* Add default back to speed

* Remove update check code

Finicky at best and most likely prone to breaking

* Update deps

* Update vcpkg

* Adding support for 2023 models (#115)

* Adding support for 2023 models

Tested on a Legion 5 Slim:

```
System Information
        Manufacturer: LENOVO
        Product Name: 82Y9
        Version: Legion Slim 5 16APH8
        Serial Number: <Redacted>
        UUID: <Redacted>
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_82Y9_BU_idea_FM_Legion Slim 5 16APH8
        Family: Legion Slim 5 16APH8

```

* fixing minor typo in README

* Fix device arr length

* Update version

* Fix release CI

---------

Co-authored-by: Mario Bălănică <[email protected]>
Co-authored-by: rslarson <[email protected]>
Co-authored-by: pavelsevcik <[email protected]>
  • Loading branch information
4 people authored Jun 22, 2023
1 parent 5a6cc0f commit ff18392
Show file tree
Hide file tree
Showing 108 changed files with 9,973 additions and 8,782 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
liberapay: 4JX
custom: ['https://www.buymeacoffee.com/4JXdev']
59 changes: 40 additions & 19 deletions .github/workflows/compile-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ jobs:
os: ubuntu-latest
artifact_name: target/debug/legion-kb-rgb
asset_name: legion-kb-rgb-linux
triplet: x64-linux
vcpkgCommitId: 'f6a5d4e8eb7476b8d7fc12a56dff300c1c986131'
- name: windows
os: windows-latest
artifact_name: target/debug/legion-kb-rgb.exe
asset_name: legion-kb-rgb-windows
triplet: x64-windows-static
vcpkgCommitId: 'f6a5d4e8eb7476b8d7fc12a56dff300c1c986131'

env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed

steps:
- uses: actions/cache@v2
- name: Checkout
uses: actions/checkout@v3

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
Expand All @@ -35,35 +48,43 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set VCPKG_ROOT
run: echo "VCPKG_ROOT=$(echo $VCPKG_INSTALLATION_ROOT)" >> $GITHUB_ENV
shell: bash
restore-keys: ${{ runner.os }}-cargo-

- name: Download dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libpango1.0-dev libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libudev-dev nasm libxcb-randr0-dev libusb-1.0-0-dev libdbus-1-dev ninja-build
vcpkg update && vcpkg install libvpx libyuv
sudo apt-get update -y
sudo apt install -y libunwind-dev
sudo apt-get install -y libx11-dev nasm libdbus-1-dev libudev-dev libxcb-randr0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libxi-dev libxtst-dev libusb-1.0-0-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install nasm ninja
vcpkg update && vcpkg install libvpx libyuv
brew install nasm
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install ninja
vcpkg update && vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static
echo "Nothing to do."
fi
shell: bash
- uses: actions/checkout@v2
- name: Build
shell: cmd
run: |
set PATH=C:\msys64\mingw64\bin;%PATH%
cargo build --verbose
if: matrix.os == 'windows-latest'

- name: Set up VCPKG deps
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
# Run vcpkg with the command specified by the `runVcpkgFormatString` input.
runVcpkgInstall: true
vcpkgJsonGlob: '**/vcpkg.json'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'

# - name: Prints output of run-vcpkg's action.
# run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
# - name: Set VCPKG_ROOT
# run: echo "VCPKG_ROOT=$(echo $VCPKG_INSTALLATION_ROOT)" >> $GITHUB_ENV
# shell: bash

- name: Build
shell: bash
run: cargo build --verbose
if: matrix.os != 'windows-latest'

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.artifact_name }}
60 changes: 41 additions & 19 deletions .github/workflows/release-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ jobs:
os: ubuntu-latest
artifact_name: target/release/legion-kb-rgb
asset_name: legion-kb-rgb-linux
triplet: x64-linux
vcpkgCommitId: 'f6a5d4e8eb7476b8d7fc12a56dff300c1c986131'
- name: windows
os: windows-latest
artifact_name: target/release/legion-kb-rgb.exe
asset_name: legion-kb-rgb-windows
triplet: x64-windows-static
vcpkgCommitId: 'f6a5d4e8eb7476b8d7fc12a56dff300c1c986131'

env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed

steps:
- uses: actions/cache@v2
- name: Checkout
uses: actions/checkout@v3

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
Expand All @@ -35,35 +48,44 @@ jobs:
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set VCPKG_ROOT
run: echo "VCPKG_ROOT=$(echo $VCPKG_INSTALLATION_ROOT)" >> $GITHUB_ENV
shell: bash
restore-keys: ${{ runner.os }}-cargo-

- name: Download dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libpango1.0-dev libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libudev-dev nasm libxcb-randr0-dev libusb-1.0-0-dev libdbus-1-dev ninja-build
vcpkg update && vcpkg install libvpx libyuv
sudo apt-get update -y
sudo apt install -y libunwind-dev
sudo apt-get install -y libx11-dev nasm libdbus-1-dev libudev-dev libxcb-randr0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libxi-dev libxtst-dev libusb-1.0-0-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install nasm ninja
vcpkg update && vcpkg install libvpx libyuv
brew install nasm
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install ninja
vcpkg update && vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static
echo "Nothing to do."
fi
shell: bash
- uses: actions/checkout@v2
- name: Build
shell: cmd
run: |
set PATH=C:\msys64\mingw64\bin;%PATH%
cargo build --release --verbose
if: matrix.os == 'windows-latest'

- name: Set up VCPKG deps
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
# Run vcpkg with the command specified by the `runVcpkgFormatString` input.
runVcpkgInstall: true
vcpkgJsonGlob: '**/vcpkg.json'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'

# - name: Prints output of run-vcpkg's action.
# run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "

# - name: Set VCPKG_ROOT
# run: echo "VCPKG_ROOT=$(echo $VCPKG_INSTALLATION_ROOT)" >> $GITHUB_ENV
# shell: bash

- name: Build
shell: bash
run: cargo build --release --verbose
if: matrix.os != 'windows-latest'

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.artifact_name }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# Rust
target

# Nix
.direnv
result

# Other
things.md
*.json
Expand Down
Loading

0 comments on commit ff18392

Please sign in to comment.