Showing preview only (1,293K chars total). Download the full file or copy to clipboard to get everything.
Repository: pop-os/keyboard-configurator
Branch: master
Commit: 676cdc6bba54
Files: 316
Total size: 1.2 MB
Directory structure:
gitextract_79fuba_k/
├── .cargo/
│ └── config
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── version.py
├── .gitignore
├── Cargo.toml
├── LICENSE
├── Makefile
├── README.md
├── RELEASING.md
├── backend/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── examples/
│ │ ├── benchmark.rs
│ │ └── daemon.rs
│ ├── i18n.toml
│ └── src/
│ ├── backend.rs
│ ├── benchmark/
│ │ ├── block_dev.rs
│ │ ├── mod.rs
│ │ ├── usb_dev.rs
│ │ └── usb_hub.rs
│ ├── board.rs
│ ├── color.rs
│ ├── daemon/
│ │ ├── client.rs
│ │ ├── daemon_thread.rs
│ │ ├── dummy.rs
│ │ ├── mod.rs
│ │ ├── s76power.rs
│ │ └── server.rs
│ ├── deref_cell.rs
│ ├── key.rs
│ ├── keymap.rs
│ ├── layer.rs
│ ├── layout/
│ │ ├── meta.rs
│ │ ├── mod.rs
│ │ └── physical_layout.rs
│ ├── lib.rs
│ ├── localize.rs
│ ├── matrix.rs
│ ├── mode.rs
│ ├── nelson.rs
│ └── rect.rs
├── build.rs
├── data/
│ ├── com.system76.keyboardconfigurator.gresource.xml
│ ├── system76_launch_1_default.hex
│ ├── system76_launch_2_default.hex
│ ├── system76_launch_heavy_1_default.hex
│ └── system76_launch_lite_1_default.hex
├── debian/
│ ├── changelog
│ ├── com.system76.pkexec.keyboardconfigurator.policy
│ ├── compat
│ ├── control
│ ├── copyright
│ ├── libsystem76-keyboard-configurator-dev.install
│ ├── libsystem76-keyboard-configurator.install
│ ├── libsystem76-keyboard-configurator.trigger
│ ├── rules
│ ├── source/
│ │ ├── format
│ │ └── options
│ ├── system76-keyboard-configurator.install
│ └── test-launch-system76-keyboard-configurator.install
├── ffi/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── src/
│ │ └── lib.rs
│ ├── system76_keyboard_configurator.h
│ └── system76_keyboard_configurator.pc.in
├── flake.nix
├── i18n/
│ ├── cs/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── da/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── de/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── en/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── es/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── fi/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── fr/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── hu/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── it/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── ko/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── nl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── pl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── pt-BR/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── ru/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── sl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ └── tr/
│ ├── system76_keyboard_configurator.ftl
│ ├── system76_keyboard_configurator_backend.ftl
│ └── system76_keyboard_configurator_widgets.ftl
├── i18n.toml
├── layouts/
│ ├── README.md
│ ├── keyboards/
│ │ └── system76/
│ │ ├── 14in_81/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 14in_83/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 14in_86/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 15in_102/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 15in_102_nkey/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 18H9LHA04/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 18H9LHA05/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_2/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_3/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_alpha_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_alpha_2/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_heavy_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_heavy_3/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ └── launch_lite_1/
│ │ ├── layout.json
│ │ ├── leds.json
│ │ └── physical.json
│ ├── keymap/
│ │ ├── ec.json
│ │ ├── qmk.json
│ │ └── qmk_legacy.json
│ ├── picker.json
│ └── system76/
│ ├── addw1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw4/
│ │ ├── default.json
│ │ └── meta.json
│ ├── bonw14/
│ │ ├── default.json
│ │ └── meta.json
│ ├── bonw15/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp10-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp11-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp8/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp9/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp3-c/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp4/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze15/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3050/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3060/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3060-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze17-3050/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze17-3060-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze18/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze20/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_alpha_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_alpha_2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_heavy_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_heavy_3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_lite_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp12/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp13/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp13-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp9/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp12/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp8/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp9/
│ │ ├── default.json
│ │ └── meta.json
│ └── serw13/
│ ├── default.json
│ └── meta.json
├── layouts.py
├── linux/
│ ├── build.py
│ ├── com.system76.keyboardconfigurator.appdata.xml
│ ├── com.system76.keyboardconfigurator.desktop
│ ├── com.system76.keyboardconfiguratorlaunchtest.desktop
│ └── linuxdeploy-plugin-gtk.sh
├── macos/
│ ├── Info.plist.in
│ ├── README.md
│ ├── appdmg.json
│ ├── build.py
│ ├── deploy.py
│ ├── launcher.sh
│ └── signing.sh
├── rust-toolchain.toml
├── src/
│ ├── about_dialog.rs
│ ├── backlight.rs
│ ├── configurator_app.rs
│ ├── error_dialog.rs
│ ├── keyboard.rs
│ ├── keyboard_layer.rs
│ ├── localize.rs
│ ├── main.rs
│ ├── main_window.rs
│ ├── page.rs
│ ├── picker/
│ │ ├── mod.rs
│ │ ├── picker_group.rs
│ │ ├── picker_group_box.rs
│ │ ├── picker_json.rs
│ │ └── picker_key.rs
│ ├── shortcuts_window.rs
│ ├── shortcuts_window.ui
│ └── testing.rs
├── tools/
│ ├── Cargo.toml
│ └── src/
│ └── pkgconfig.rs
├── widgets/
│ ├── Cargo.toml
│ ├── examples/
│ │ └── keyboard_color.rs
│ ├── i18n.toml
│ └── src/
│ ├── choose_color.rs
│ ├── color_circle.rs
│ ├── color_wheel.rs
│ ├── keyboard_backlight_widget.rs
│ ├── keyboard_color.rs
│ ├── lib.rs
│ ├── localize.rs
│ └── selected_keys.rs
└── windows/
├── README.md
├── build.bat
├── build.py
├── gpl.rtf
└── keyboard-configurator.wxs
================================================
FILE CONTENTS
================================================
================================================
FILE: .cargo/config
================================================
[target.'cfg(target_os = "macos")']
rustflags = ["-C", "link-args=-headerpad_max_install_names"]
================================================
FILE: .github/workflows/ci.yml
================================================
on:
push:
branches: '**'
tags-ignore: '**'
pull_request:
release:
types: [published]
name: ci
env:
RELEASE: ${{ github.event_name == 'release' && '--release' || '' }}
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install libgtk-3-dev libhidapi-dev libudev-dev
- uses: actions/checkout@v4
- run: rustup component add rustfmt
- run: cargo test --all
- run: cargo fmt -- --check
linux-x86_64:
runs-on: ubuntu-22.04
steps:
- run: sudo apt-get update && sudo apt-get install cargo libgtk-3-dev libhidapi-dev libudev-dev patchelf
- uses: actions/checkout@v4
- run: cd linux && ./build.py $RELEASE
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: keyboard-configurator-linux-x86_64-${{ github.sha }}
path: linux/keyboard-configurator-x86_64.AppImage
linux-x86_64-test:
runs-on: ubuntu-latest
needs: linux-x86_64
steps:
- run: sudo apt-get install xvfb libfuse2
- uses: actions/download-artifact@v4
with:
name: keyboard-configurator-linux-x86_64-${{ github.sha }}
- run: chmod +x keyboard-configurator-x86_64.AppImage
- run: xvfb-run ./keyboard-configurator-x86_64.AppImage --help-gtk
linux-arm64:
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install cargo libgtk-3-dev libhidapi-dev libudev-dev patchelf libfuse2
- run: cd linux && ./build.py --arm64 $RELEASE
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: keyboard-configurator-linux-aarch64-${{ github.sha }}
path: linux/keyboard-configurator-aarch64.AppImage
linux-arm64-test:
runs-on: ubuntu-22.04-arm
needs: linux-arm64
steps:
- run: sudo apt-get install xvfb libfuse2
- uses: actions/download-artifact@v4
with:
name: keyboard-configurator-linux-aarch64-${{ github.sha }}
- run: chmod +x keyboard-configurator-aarch64.AppImage
- run: xvfb-run ./keyboard-configurator-aarch64.AppImage --help-gtk
windows-mingw32:
runs-on: windows-latest
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: mingw-w64-i686-gtk3 mingw-w64-i686-rust mingw-w64-i686-toolchain mingw-w64-i686-ntldd mingw-w64-x86_64-imagemagick
- uses: actions/checkout@v4
- name: Build and package
shell: msys2 {0}
env:
SSL_COM_USERNAME: ${{ github.event_name == 'release' && secrets.SSL_COM_USERNAME || '' }}
SSL_COM_PASSWORD: ${{ github.event_name == 'release' && secrets.SSL_COM_PASSWORD || '' }}
SSL_COM_CREDENTIAL_ID: ${{ github.event_name == 'release' && secrets.SSL_COM_CREDENTIAL_ID || '' }}
SSL_COM_TOTP_SECRET: ${{ github.event_name == 'release' && secrets.SSL_COM_TOTP_SECRET || '' }}
MSYS2_ENV_CONV_EXCL: SSL_COM_TOTP_SECRET
SIGN: ${{ github.event_name == 'release' && '--sign' || '' }}
run: cd windows && python build.py $RELEASE $SIGN
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: keyboard-configurator-mingw32-${{ github.sha }}
path: windows/keyboard-configurator.msi
windows-mingw32-test:
runs-on: windows-latest
needs: windows-mingw32
steps:
- uses: actions/download-artifact@v4
with:
name: keyboard-configurator-mingw32-${{ github.sha }}
- run: msiexec /i keyboard-configurator.msi /qb
- run: Start-Sleep 10
- run: '& "C:\Program Files (x86)\System76\Keyboard Configurator\system76-keyboard-configurator.exe" --help-gtk'
macos:
runs-on: macos-14-large # Intel
steps:
- run: brew install gtk+3 imagemagick librsvg adwaita-icon-theme
- run: npm install -g appdmg
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- env:
AC_PASSWORD: ${{ github.event_name == 'release' && secrets.AC_PASSWORD || '' }}
AC_USERNAME: ${{ github.event_name == 'release' && secrets.AC_USERNAME || '' }}
MACOS_CERTIFICATE: ${{ github.event_name == 'release' && secrets.MACOS_CERTIFICATE || '' }}
MACOS_SCRIPT: ${{ github.event_name == 'release' && 'bash ./signing.sh' || 'python3 ./build.py' }}
run: cd macos && $MACOS_SCRIPT $RELEASE
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: keyboard-configurator-macos-${{ github.sha }}
path: macos/keyboard-configurator.dmg
macos-test:
runs-on: macos-14-large # Intel
needs: macos
steps:
- uses: actions/download-artifact@v4
with:
name: keyboard-configurator-macos-${{ github.sha }}
- run: mkdir mnt && hdiutil attach keyboard-configurator.dmg -mountpoint $PWD/mnt
- run: '"./mnt/System76 Keyboard Configurator.app/Contents/MacOS/keyboard-configurator" --help-gtk'
- run: 'open "mnt/System76 Keyboard Configurator.app" --args --help-gtk'
macos-arm64:
runs-on: macos-14 # arm64
steps:
- run: brew install gtk+3 imagemagick librsvg adwaita-icon-theme
- run: npm install -g appdmg
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- env:
AC_PASSWORD: ${{ github.event_name == 'release' && secrets.AC_PASSWORD || '' }}
AC_USERNAME: ${{ github.event_name == 'release' && secrets.AC_USERNAME || '' }}
MACOS_CERTIFICATE: ${{ github.event_name == 'release' && secrets.MACOS_CERTIFICATE || '' }}
MACOS_SCRIPT: ${{ github.event_name == 'release' && 'bash ./signing.sh' || 'python3 ./build.py' }}
run: cd macos && $MACOS_SCRIPT $RELEASE
- run: mv macos/keyboard-configurator.dmg macos/keyboard-configurator-arm64.dmg
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: keyboard-configurator-macos-arm64-${{ github.sha }}
path: macos/keyboard-configurator-arm64.dmg
macos-arm64-test:
runs-on: macos-14 # arm64
needs: macos-arm64
steps:
- uses: actions/download-artifact@v4
with:
name: keyboard-configurator-macos-arm64-${{ github.sha }}
- run: mkdir mnt && hdiutil attach keyboard-configurator-arm64.dmg -mountpoint $PWD/mnt
- run: '"./mnt/System76 Keyboard Configurator.app/Contents/MacOS/keyboard-configurator" --help-gtk'
- run: 'open "mnt/System76 Keyboard Configurator.app" --args --help-gtk'
upload-to-release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: [linux-x86_64, linux-arm64, windows-mingw32, macos, macos-arm64]
steps:
- uses: actions/checkout@v4
- run: echo VERSION=$(./.github/workflows/version.py) > $GITHUB_ENV
- uses: actions/download-artifact@v4
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-linux-x86_64-${{ github.sha }}/keyboard-configurator-x86_64.AppImage
asset_name: keyboard-configurator-${{ env.VERSION }}-x86_64.AppImage
asset_content_type: application/vnd.appimage
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-linux-aarch64-${{ github.sha }}/keyboard-configurator-aarch64.AppImage
asset_name: keyboard-configurator-${{ env.VERSION }}-aarch64.AppImage
asset_content_type: application/vnd.appimage
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-mingw32-${{ github.sha }}/keyboard-configurator.msi
asset_name: keyboard-configurator-${{ env.VERSION }}.msi
asset_content_type: application/x-msi
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-macos-${{ github.sha }}/keyboard-configurator.dmg
asset_name: keyboard-configurator-${{ env.VERSION }}.dmg
asset_content_type: application/x-apple-diskimage
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: keyboard-configurator-macos-arm64-${{ github.sha }}/keyboard-configurator-arm64.dmg
asset_name: keyboard-configurator-arm64-${{ env.VERSION }}.dmg
asset_content_type: application/x-apple-diskimage
================================================
FILE: .github/workflows/version.py
================================================
#!/usr/bin/env python3
import json
import subprocess
meta_str = subprocess.check_output(["cargo", "metadata", "--format-version", "1", "--no-deps"])
meta = json.loads(meta_str)
package = next(i for i in meta['packages'] if i['name'] == 'system76-keyboard-configurator')
print(package['version'])
================================================
FILE: .gitignore
================================================
/result
/target
/linux/system76-keyboard-configurator
/windows/out
/windows/sign
/windows/libraries.wxi
/windows/*.png
/windows/*.bmp
/macos/Info.plist
/macos/background.png
/macos/keyboard-configurator
*.AppDir
*.AppImage
*.msi
*.wixobj
*.wixpdb
*.dmg
*.icns
*.app
.DS_Store
__pycache__
vendor
vendor.tar
gschemas.compiled
debian/.debhelper/
debian/debhelper-build-stamp
debian/files
debian/libsystem76-keyboard-configurator-dev.debhelper.log
debian/libsystem76-keyboard-configurator-dev.substvars
debian/libsystem76-keyboard-configurator-dev/
debian/libsystem76-keyboard-configurator.debhelper.log
debian/libsystem76-keyboard-configurator.substvars
debian/libsystem76-keyboard-configurator/
debian/system76-keyboard-configurator.debhelper.log
debian/system76-keyboard-configurator.substvars
debian/system76-keyboard-configurator/
debian/tmp/
================================================
FILE: Cargo.toml
================================================
[package]
name = "system76-keyboard-configurator"
version = "1.3.13"
authors = ["Ian Douglas Scott <idscott@system76.com>", "Jeremy Soller <jeremy@system76.com>"]
license = "GPL-3.0-or-later"
edition = "2021"
rust-version = "1.64"
[workspace]
members = [ "tools", "ffi", "backend", "widgets" ]
[dependencies]
cascade = "1"
futures = "0.3.13"
gtk = { version = "0.18.0" }
libc = "0.2"
once_cell = "1.4"
pangocairo = "0.18.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4.0"
env_logger = "0.10"
backend = { package = "system76-keyboard-configurator-backend", path = "backend" }
widgets = { package = "system76-keyboard-configurator-widgets", path = "widgets" }
# Translation support
i18n-embed = { version = "0.13.0", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.0"
rust-embed = { version = "6.2.0", features = ["debug-embed"] }
[build-dependencies]
glib-build-tools = "0.18.0"
[target.'cfg(target_os = "windows")'.dependencies]
winreg = "0.8"
[features]
appimage = ["backend/appimage"]
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: Makefile
================================================
prefix ?= /usr/local
bindir = $(prefix)/bin
libdir = $(prefix)/lib
includedir = $(prefix)/include
datarootdir = $(prefix)/share
datadir = $(datarootdir)
TARGET = debug
DEBUG ?= 0
ifeq ($(DEBUG),0)
TARGET = release
ARGS += --release
endif
VENDOR ?= 0
ifneq ($(VENDOR),0)
ARGS += --frozen
endif
PACKAGE = system76_keyboard_configurator
APPID = "com.system76.keyboardconfigurator"
PKGCONFIG = $(PACKAGE).pc
BIN = system76-keyboard-configurator
FFI = lib$(PACKAGE).so
APPDATA = $(APPID).appdata.xml
DESKTOP = $(APPID).desktop
ICON = data/icons/scalable/apps/$(APPID).svg
all: $(BIN) $(PKGCONFIG)
clean:
rm -rf target
distclean: clean
rm -rf .cargo vendor vendor.tar
$(BIN): Cargo.toml Cargo.lock src/main.rs vendor-check
cargo build $(ARGS)
$(FFI): Cargo.toml Cargo.lock ffi/src/lib.rs vendor-check
cargo build $(ARGS) --manifest-path ffi/Cargo.toml
install:
install -Dm0755 target/$(TARGET)/$(BIN) $(DESTDIR)$(bindir)/$(BIN)
install -Dm0644 target/$(TARGET)/$(FFI) "$(DESTDIR)$(libdir)/$(FFI)"
install -Dm0644 target/$(PKGCONFIG) "$(DESTDIR)$(libdir)/pkgconfig/$(PKGCONFIG)"
install -Dm0644 ffi/$(PACKAGE).h "$(DESTDIR)$(includedir)/$(PACKAGE).h"
install -Dm0644 "linux/$(DESKTOP)" "$(DESTDIR)$(datadir)/applications/$(DESKTOP)"
install -Dm0644 "linux/$(APPDATA)" "$(DESTDIR)$(datadir)/metainfo/$(APPDATA)"
install -Dm0644 $(ICON) "$(DESTDIR)$(datadir)/icons/hicolor/scalable/apps/$(APPID).svg"
$(PKGCONFIG): $(FFI) tools/src/pkgconfig.rs
cargo run -p tools --bin pkgconfig $(DESKTOP_ARGS) -- \
$(PACKAGE) $(libdir) $(includedir)
## Cargo Vendoring
vendor:
rm .cargo -rf
mkdir -p .cargo
cargo vendor | head -n -1 > .cargo/config
echo 'directory = "vendor"' >> .cargo/config
tar cf vendor.tar vendor
rm -rf vendor
vendor-check:
ifeq ($(VENDOR),1)
rm vendor -rf && tar xf vendor.tar
endif
================================================
FILE: README.md
================================================
# System76 Keyboard Configurator
Tool for configuring System76 keyboards, internal and external, with support for changing the keymap and LED settings.
This requires a System76 laptop with recent open EC firmware, or a Launch keyboard. Note that LED settings are not currently persisted on internal keyboards.
## Releases
See [releases](https://github.com/pop-os/keyboard-configurator/releases) page for pre-built binaries of the latest tagged release.
## Building
```
# Install dependencies if necessary
sudo apt-get install cargo libgtk-3-dev libhidapi-dev libudev-dev
# Clone keyboard-configurator if necessary
git clone https://github.com/pop-os/keyboard-configurator
# Make sure it is up to date
cd keyboard-configurator
git pull
# Build and run the configurator
cargo run --release
```
## Translators
Translators are welcome to submit translations directly as a pull request to this project. It is generally expected that your pull requests will contain a single commit for each language that was added or improved, using a syntax like so:
```
i18n(eo): Add Esperanto language support
```
```
i18n(pl): Improvements to Polish language support
```
Translation files can be found [here](./i18n/). We are using [Project Fluent](https://projectfluent.org) for our translations, which should be easier than working with gettext.
================================================
FILE: RELEASING.md
================================================
# Releasing
* Make sure all builds and tests are passing on CI.
* Update version in `Cargo.toml`.
* Add new release to `debian/changelog`.
* No change is needed in `windows/keyboard-configurator.wxs` or `macos/Info.plist`
- `windows/build.py` and `macos/build.py` populate the version from `Cargo.toml`
- `UpgradeCode` should **not** be changed between releases.
* Create a release on Github
- Github Actions will automatically build artifacts in release mode, and attach them to the release.
* Deploy release to Pop!\_OS repos.
================================================
FILE: backend/Cargo.toml
================================================
[package]
name = "system76-keyboard-configurator-backend"
version = "0.1.0"
authors = ["Ian Douglas Scott <idscott@system76.com>", "Jeremy Soller <jeremy@system76.com>"]
license = "GPL-3.0-or-later"
edition = "2021"
[dependencies]
async-process = "1.7.0"
cascade = "1"
futures = { version = "0.3.13", features = ["thread-pool"] }
futures-timer = "3.0.2"
glib = { version = "0.18.0", optional = true }
hidapi = { version = "1.2", default-features = false, features = ["linux-shared-hidraw"] }
libc = "0.2"
once_cell = "1.4"
ordered-float = { version = "3.0", features = ["serde"] }
palette = "0.5"
regex = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4.0"
uuid = { version = "1", features = ["v4"] }
i18n-embed = { version = "0.13.0", features = ["fluent-system", "desktop-requester"] }
i18n-embed-fl = "0.6.0"
rust-embed = { version = "6.2.0", features = ["debug-embed"] }
[dependencies.system76_ectool]
version = "0.3.8"
features = ["hidapi", "std"]
[target.'cfg(target_os = "linux")'.dependencies]
zbus = "3"
[build-dependencies]
serde_json = "1.0"
[dev-dependencies]
libc = "0.2"
[features]
appimage = []
================================================
FILE: backend/build.rs
================================================
use std::{
env,
fs::{self, File},
io::Write,
path::Path,
};
fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let mut outfile = File::create(Path::new(&out_dir).join("keyboards.rs")).unwrap();
writeln!(outfile, "keyboards![").unwrap();
println!("cargo:rerun-if-changed=../layouts/system76");
for i in fs::read_dir("../layouts/system76").unwrap() {
let i = i.unwrap();
let path = i.path().join("meta.json");
let meta = serde_json::from_reader::<_, serde_json::Map<_, _>>(File::open(&path).unwrap())
.unwrap();
let file_name = i.file_name().into_string().unwrap();
let keyboard = meta
.get("keyboard")
.and_then(|x| x.as_str())
.unwrap_or_else(|| {
panic!("'keyboard:' not found in {}", path.display());
});
let is_qmk = meta
.get("is_qmk")
.and_then(|v| v.as_bool())
.unwrap_or(false);
writeln!(
outfile,
" (\"system76/{}\", \"{}\", {}),",
file_name, keyboard, is_qmk
)
.unwrap();
println!("cargo:rerun-if-changed=../layouts/system76/{}", file_name);
println!("cargo:rerun-if-changed=../layouts/keyboards/{}", keyboard);
}
writeln!(outfile, "];").unwrap();
}
================================================
FILE: backend/examples/benchmark.rs
================================================
use std::io;
use system76_keyboard_configurator_backend::Benchmark;
fn benchmark() -> io::Result<()> {
let benchmark = Benchmark::new()?;
for (port_desc, port_result) in benchmark.port_results.iter() {
eprintln!("{}: {:.2?}", port_desc, port_result);
}
Ok(())
}
fn main() {
benchmark().unwrap();
}
================================================
FILE: backend/examples/daemon.rs
================================================
use std::env;
use system76_keyboard_configurator_backend::{run_daemon, Backend, Events};
#[cfg(target_os = "linux")]
fn with_daemon<F: Fn(Backend, Events)>(f: F) {
let (backend, events) = if unsafe { libc::geteuid() == 0 } {
eprintln!("Already running as root");
Backend::new().expect("Failed to create server")
} else {
Backend::new_pkexec().unwrap()
};
f(backend, events);
}
#[cfg(not(target_os = "linux"))]
fn with_daemon<F: Fn(Backend, Events)>(f: F) {
let (backend, events) = Backend::new().expect("Failed to create server");
f(backend, events);
}
fn main() {
for arg in env::args().skip(1) {
if arg.as_str() == "--daemon" {
run_daemon()
}
}
with_daemon(|_backend, _events| {
// println!("boards: {:?}", daemon.boards());
});
}
================================================
FILE: backend/i18n.toml
================================================
fallback_language = "en"
[fluent]
assets_dir = "../i18n"
================================================
FILE: backend/src/backend.rs
================================================
use futures::{
channel::mpsc as async_mpsc,
stream::{FusedStream, Stream},
};
use std::{
pin::Pin,
process,
sync::Arc,
task::{Context, Poll},
time::Duration,
};
use crate::daemon::*;
use crate::{Board, BoardEvent, Bootloaded};
#[derive(Clone, Debug)]
pub enum Event {
BoardLoading,
BoardLoadingDone,
BoardNotUpdated,
Board(BoardId, BoardEvent),
BoardAdded(Board),
BoardRemoved(BoardId),
BootloadedAdded(Bootloaded),
BootloadedRemoved,
}
#[derive(Debug)]
pub struct Events(async_mpsc::UnboundedReceiver<Event>);
impl Stream for Events {
type Item = Event;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Event>> {
let receiver = &mut self.get_mut().0;
futures::pin_mut!(receiver);
receiver.poll_next(cx)
}
}
impl FusedStream for Events {
fn is_terminated(&self) -> bool {
self.0.is_terminated()
}
}
impl Unpin for Events {}
#[derive(Debug)]
struct BackendInner {
thread_client: Arc<ThreadClient>,
executor: futures::executor::ThreadPool,
}
#[derive(Clone, Debug)]
pub struct Backend(Arc<BackendInner>);
unsafe impl Send for Backend {}
impl Backend {
fn new_internal<T: Daemon + 'static>(daemon: T) -> Result<(Self, Events), String> {
let (sender, receiver) = async_mpsc::unbounded();
let executor = futures::executor::ThreadPool::builder()
.pool_size(1)
.create()
.unwrap();
let thread_client = ThreadClient::new(Box::new(daemon), sender);
Ok((
Self(Arc::new(BackendInner {
thread_client,
executor,
})),
Events(receiver),
))
}
pub fn new_dummy(board_names: Vec<String>) -> Result<(Self, Events), String> {
let dummy_daemon = DaemonDummy::new(board_names)?;
Self::new_internal(dummy_daemon)
}
#[cfg(target_os = "linux")]
pub fn new_s76power() -> Result<(Self, Events), String> {
Self::new_internal(DaemonS76Power::new()?)
}
pub fn new_pkexec() -> Result<(Self, Events), String> {
Self::new_internal(DaemonClient::new_pkexec())
}
pub fn new() -> Result<(Self, Events), String> {
Self::new_internal(DaemonServer::new_stdio()?)
}
/// Test for added/removed boards, emitting `board-added`/`board-removed` signals
///
/// This function does not block, and loads new boards in the background.
pub fn refresh(&self) {
let self_ = self.clone();
self.0.executor.spawn_ok(async move {
if let Err(err) = self_.0.thread_client.refresh().await {
error!("Failed to refresh boards: {}", err);
}
});
}
pub fn check_for_bootloader(&self) {
let self_ = self.clone();
self.0.executor.spawn_ok(async move {
if let Err(err) = self_.0.thread_client.check_for_bootloader().await {
error!("Failed to check for board in bootloader mode: {}", err);
}
});
}
pub fn set_matrix_get_rate(&self, rate: Option<Duration>) {
let self_ = self.clone();
self.0.executor.spawn_ok(async move {
let _ = self_.0.thread_client.set_matrix_get_rate(rate).await;
});
}
}
impl Drop for BackendInner {
fn drop(&mut self) {
self.thread_client.close();
}
}
pub fn run_daemon() -> ! {
let server = DaemonServer::new_stdio().expect("Failed to create server");
server.run().expect("Failed to run server");
process::exit(0)
}
================================================
FILE: backend/src/benchmark/block_dev.rs
================================================
#[cfg(target_os = "linux")]
use std::os::unix::fs::OpenOptionsExt;
use std::{
alloc::{alloc, dealloc, handle_alloc_error, Layout},
fs,
io::{self, Read},
path::{Path, PathBuf},
slice, time,
};
const ALIGN: usize = 4096;
const SIZE: usize = ALIGN * 1024;
#[derive(Eq, Ord, PartialEq, PartialOrd)]
pub struct BlockDev(PathBuf);
impl BlockDev {
pub fn new(path: PathBuf) -> Self {
Self(path)
}
pub fn path(&self) -> &Path {
&self.0
}
pub fn benchmark(&self) -> io::Result<f64> {
let mut open_options = fs::OpenOptions::new();
open_options.read(true);
#[cfg(target_os = "linux")]
open_options.custom_flags(libc::O_DIRECT);
let mut file = open_options.open(self.path())?;
// Buffer needs to be aligned for direct reads
let layout = Layout::from_size_align(SIZE, ALIGN).unwrap();
let ptr = unsafe { alloc(layout) };
if ptr.is_null() {
handle_alloc_error(layout);
}
let (res, elapsed) = {
let data = unsafe { slice::from_raw_parts_mut(ptr as *mut u8, SIZE) };
let start = time::Instant::now();
(file.read(data), start.elapsed())
};
unsafe {
dealloc(ptr, layout);
}
// Do this after free to ensure no memory leaks
res?;
Ok(4.0 / elapsed.as_secs_f64())
}
}
================================================
FILE: backend/src/benchmark/mod.rs
================================================
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, io};
use self::usb_hub::UsbHub;
mod block_dev;
mod usb_dev;
mod usb_hub;
#[derive(Debug, Deserialize, Serialize)]
pub struct Benchmark {
pub port_results: BTreeMap<String, Result<f64, String>>,
}
impl Benchmark {
pub fn new() -> io::Result<Self> {
let hubs = UsbHub::probe()?;
let mut port_descs = BTreeMap::new();
port_descs.insert("1", "USB-C Right");
port_descs.insert("2", "USB-A Right");
port_descs.insert("3", "USB-A Left");
port_descs.insert("4", "USB-C Left");
let mut usb_2_hubs = 0;
let mut usb_3_hubs = 0;
for hub in hubs.iter() {
match hub {
UsbHub::Usb2(_) => usb_2_hubs += 1,
UsbHub::Usb3(_) => usb_3_hubs += 1,
}
}
if usb_2_hubs != 1 {
return Err(io::Error::new(
io::ErrorKind::Other,
format!("Found {} USB 2 hubs instead of 1", usb_2_hubs),
));
}
if usb_3_hubs != 1 {
return Err(io::Error::new(
io::ErrorKind::Other,
format!("Found {} USB 3 hubs instead of 1", usb_3_hubs),
));
}
let mut port_results = BTreeMap::new();
for hub in hubs.iter() {
let (required_speed, speed_name) = match hub {
UsbHub::Usb2(_) => (
1.5, // USB 1.1 max speed is 12 Mbps or 1.5 MBps
"USB 2.0",
),
UsbHub::Usb3(_) => (
60.0, // USB 2.0 max speed is 480 Mbps or 60 MBps
"USB 3.2 Gen 2",
),
};
for (port_name, dev) in hub.ports()?.iter() {
let port_desc = match port_descs.get(port_name.as_str()) {
Some(some) => some,
// Ports 5 and 6 connect to the Launch microcontroller (port 5)
// and an integrated hub device (port 6)
None => continue,
};
let port_result = if dev.path().is_dir() {
let mut best_speed = -1.0;
for block_dev in dev.block_devs()? {
match block_dev.benchmark() {
Ok(benchmark) => {
if benchmark > best_speed {
best_speed = benchmark;
}
}
Err(_err) => {
//TODO: do something with error
}
}
}
if best_speed < 0.0 {
Err("no accessible disks".to_string())
} else if best_speed > required_speed {
Ok(best_speed)
} else {
Err(format!("benchmarked speed of {:.2} MB/s was less than required speed of {:.2} MB/s", best_speed, required_speed))
}
} else {
Err("no devices".to_string())
};
port_results.insert(format!("{}: {}", speed_name, port_desc), port_result);
}
}
Ok(Self { port_results })
}
}
================================================
FILE: backend/src/benchmark/usb_dev.rs
================================================
use std::{
fs, io,
path::{Path, PathBuf},
};
use super::block_dev::BlockDev;
pub struct UsbDev(PathBuf);
impl UsbDev {
pub fn new(path: PathBuf) -> Self {
Self(path)
}
pub fn path(&self) -> &Path {
&self.0
}
pub fn vendor_id(&self) -> io::Result<u16> {
let vid_path = self.path().join("idVendor");
let vid_str = fs::read_to_string(vid_path)?;
u16::from_str_radix(vid_str.trim(), 16)
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))
}
pub fn product_id(&self) -> io::Result<u16> {
let pid_path = self.path().join("idProduct");
let pid_str = fs::read_to_string(pid_path)?;
u16::from_str_radix(pid_str.trim(), 16)
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))
}
pub fn block_devs(&self) -> io::Result<Vec<BlockDev>> {
let mut ifaces = Vec::new();
//TODO: support multiple ifaces
let iface_suffix = ":1.0";
for entry_res in fs::read_dir(self.path())? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
if entry_name.ends_with(&iface_suffix) {
ifaces.push((entry_name, entry.path()));
}
}
}
let mut hosts = Vec::new();
for (_iface_name, iface_path) in ifaces.iter() {
let host_prefix = "host";
for entry_res in fs::read_dir(iface_path)? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
if entry_name.starts_with(host_prefix) {
hosts.push((entry_name, entry.path()));
}
}
}
}
let mut targets = Vec::new();
for (host_name, host_path) in hosts.iter() {
let host_id = host_name.trim_start_matches("host");
let target_prefix = format!("target{}:", host_id);
for entry_res in fs::read_dir(host_path)? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
if entry_name.starts_with(&target_prefix) {
targets.push((entry_name, entry.path()));
}
}
}
}
let mut disks = Vec::new();
for (target_name, target_path) in targets.iter() {
let target_id = target_name.trim_start_matches("target");
let disk_prefix = format!("{}:", target_id);
for entry_res in fs::read_dir(target_path)? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
if entry_name.starts_with(&disk_prefix) {
disks.push((entry_name, entry.path()));
}
}
}
}
let mut blocks = Vec::new();
for (_disk_name, disk_path) in disks.iter() {
let disk_block_path = disk_path.join("block");
for entry_res in fs::read_dir(&disk_block_path)? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
blocks.push((entry_name, entry.path()));
}
}
}
let mut block_devs = Vec::new();
for (block_name, _block_path) in blocks.iter() {
block_devs.push(BlockDev::new(Path::new("/dev").join(block_name)));
}
block_devs.sort();
Ok(block_devs)
}
}
================================================
FILE: backend/src/benchmark/usb_hub.rs
================================================
use std::{collections::BTreeMap, fs, io, path::Path};
use super::usb_dev::UsbDev;
const SYSTEM76_VID: u16 = 0x3384;
const USB_2_HUB_PID: u16 = 0x0003;
const USB_3_HUB_PID: u16 = 0x0004;
//TODO: Determine why USB7216 doesn't respect PID updates
const USB_2_HUB_PID_ALT: u16 = 0x4216;
const USB_3_HUB_PID_ALT: u16 = 0x7216;
pub enum UsbHub {
Usb2(UsbDev),
Usb3(UsbDev),
}
impl UsbHub {
pub fn probe() -> io::Result<Vec<Self>> {
let mut hubs = Vec::new();
for entry_res in fs::read_dir("/sys/bus/usb/devices")? {
let entry = entry_res?;
let entry_path = entry.path();
let vid_path = entry_path.join("idVendor");
let pid_path = entry_path.join("idProduct");
if vid_path.is_file() && pid_path.is_file() {
let usb = UsbDev::new(entry_path);
match (usb.vendor_id()?, usb.product_id()?) {
(SYSTEM76_VID, USB_2_HUB_PID_ALT) | (SYSTEM76_VID, USB_2_HUB_PID) => {
hubs.push(UsbHub::Usb2(usb))
}
(SYSTEM76_VID, USB_3_HUB_PID_ALT) | (SYSTEM76_VID, USB_3_HUB_PID) => {
hubs.push(UsbHub::Usb3(usb))
}
_ => (),
}
}
}
Ok(hubs)
}
pub fn usb_dev(&self) -> &UsbDev {
match self {
UsbHub::Usb2(usb) => usb,
UsbHub::Usb3(usb) => usb,
}
}
pub fn path(&self) -> &Path {
self.usb_dev().path()
}
pub fn ports(&self) -> io::Result<BTreeMap<String, UsbDev>> {
let mut hub_ports = BTreeMap::new();
let hub_path = self.path();
let hub_name = hub_path
.file_name()
.and_then(|x| x.to_str())
.ok_or_else(|| {
io::Error::new(
io::ErrorKind::InvalidData,
"hub_ports file_name not found or not UTF-8",
)
})?;
let if_path = hub_path.join(format!("{}:1.0", hub_name));
let port_prefix = format!("{}-port", hub_name);
for entry_res in fs::read_dir(&if_path)? {
let entry = entry_res?;
if let Ok(entry_name) = entry.file_name().into_string() {
if entry_name.starts_with(&port_prefix) {
let port_name = entry_name.trim_start_matches(&port_prefix);
let dev_path = entry.path().join("device");
hub_ports.insert(port_name.to_owned(), UsbDev::new(dev_path));
}
}
}
Ok(hub_ports)
}
}
================================================
FILE: backend/src/board.rs
================================================
use futures::channel::mpsc as async_mpsc;
use once_cell::sync::{Lazy, OnceCell};
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
collections::BTreeMap,
process::Command,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex, MutexGuard, Weak,
},
};
use crate::daemon::ThreadClient;
use crate::{
Benchmark, BoardId, Daemon, Event, Key, KeyMap, KeyMapLayer, Layer, Layout, Matrix, Nelson,
NelsonKind,
};
#[derive(Clone, Debug)]
pub enum BoardEvent {
KeymapChanged,
LedsChanged,
MatrixChanged,
}
#[derive(Debug)]
struct BoardInner {
thread_client: Arc<ThreadClient>,
board: BoardId,
model: String,
version: String,
layout: Layout,
keys: OnceCell<Vec<Key>>,
layers: OnceCell<Vec<Layer>>,
max_brightness: i32,
leds_changed: AtomicBool,
has_led_save: bool,
led_save_blocked: AtomicBool,
has_matrix: bool,
is_fake: bool,
has_keymap: bool,
matrix: Arc<Mutex<Matrix>>,
updated: bool,
event_sender: async_mpsc::UnboundedSender<Event>,
}
#[derive(Clone, Debug)]
pub struct Board(Arc<BoardInner>);
impl PartialEq for Board {
fn eq(&self, other: &Self) -> bool {
Arc::ptr_eq(&self.0, &other.0)
}
}
impl Eq for Board {}
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Hash, Eq)]
pub enum Bootloaded {
// Launch 2, Launch Heavy 1,
At90usb646,
// Launch Lite 1
At90usb646Lite,
// Launch 1
AtMega32u4,
}
#[derive(Debug)]
pub(crate) struct WeakBoard(Weak<BoardInner>);
impl Board {
pub fn new(
daemon: &dyn Daemon,
thread_client: Arc<ThreadClient>,
board: BoardId,
matrix: Arc<Mutex<Matrix>>,
event_sender: async_mpsc::UnboundedSender<Event>,
) -> Result<Self, String> {
let model = match daemon.model(board) {
Ok(model) => model,
Err(err) => {
return Err(format!("Failed to get board model: {}", err));
}
};
let version = daemon.version(board).unwrap_or_else(|err| {
error!("Error getting firmware version: {}", err);
String::new()
});
let layout = Layout::from_board(&model, &version)
.ok_or_else(|| format!("Failed to locate layout for '{}'", model))?;
let max_brightness = daemon.max_brightness(board).unwrap_or_else(|err| {
error!("Error getting max brightness: {}", err);
100
});
let num_layers = if layout.meta.has_per_layer {
layout.meta.num_layers
} else {
1
};
let has_led_save = daemon.led_save(board).is_ok();
let has_matrix = daemon.matrix_get(board).is_ok();
let logical = layout.layout.values().next().unwrap();
let has_keymap = daemon.keymap_get(board, 0, logical.0, logical.1).is_ok();
let self_ = Board(Arc::new(BoardInner {
thread_client,
board,
model,
version,
layout,
max_brightness,
has_led_save,
has_matrix,
is_fake: daemon.is_fake(),
has_keymap,
keys: OnceCell::new(),
layers: OnceCell::new(),
leds_changed: AtomicBool::new(false),
led_save_blocked: AtomicBool::new(false),
matrix,
event_sender,
updated: is_launch_updated().unwrap_or(false),
}));
let keys = self_
.layout()
.physical
.keys
.iter()
.map(|i| Key::new(daemon, &self_, i))
.collect();
self_.0.keys.set(keys).unwrap();
let layers = (0..num_layers)
.map(|layer| Layer::new(daemon, &self_, layer))
.collect();
self_.0.layers.set(layers).unwrap();
Ok(self_)
}
pub(crate) fn send_event(&self, event: BoardEvent) {
let _ = self
.0
.event_sender
.unbounded_send(Event::Board(self.0.board, event));
}
pub(crate) fn set_leds_changed(&self) {
self.0.leds_changed.store(true, Ordering::SeqCst);
self.send_event(BoardEvent::LedsChanged);
}
pub fn board(&self) -> BoardId {
self.0.board
}
pub(crate) fn thread_client(&self) -> &ThreadClient {
&self.0.thread_client
}
pub fn model(&self) -> &str {
&self.0.model
}
pub fn version(&self) -> &str {
&self.0.version
}
pub fn has_matrix(&self) -> bool {
self.0.has_matrix
}
pub fn max_brightness(&self) -> i32 {
self.0.max_brightness
}
pub async fn benchmark(&self) -> Result<Benchmark, String> {
self.thread_client().benchmark(self.board()).await
}
pub async fn nelson(&self, kind: NelsonKind) -> Result<Nelson, String> {
self.thread_client().nelson(self.board(), kind).await
}
pub async fn led_save(&self) -> Result<(), String> {
if self.0.led_save_blocked.load(Ordering::SeqCst) {
return Ok(());
}
if self.has_led_save() && self.0.leds_changed.load(Ordering::SeqCst) {
self.thread_client().led_save(self.board()).await?;
self.0.leds_changed.store(false, Ordering::SeqCst);
debug!("led_save");
}
Ok(())
}
pub fn block_led_save(&self) {
self.0.led_save_blocked.store(true, Ordering::SeqCst);
}
pub fn unblock_led_save(&self) {
self.0.led_save_blocked.store(false, Ordering::SeqCst);
}
pub fn is_fake(&self) -> bool {
self.0.is_fake
}
pub fn is_lite(&self) -> bool {
static RE: Lazy<Regex> = Lazy::new(|| Regex::new("system76/launch_lite_.*").unwrap());
RE.is_match(self.model())
}
pub fn is_updated(&self) -> bool {
self.0.updated
}
pub fn has_led_save(&self) -> bool {
self.0.has_led_save
}
pub fn has_keymap(&self) -> bool {
self.0.has_keymap
}
pub fn layout(&self) -> &Layout {
&self.0.layout
}
pub fn layers(&self) -> &[Layer] {
self.0.layers.get().unwrap()
}
pub fn keys(&self) -> &[Key] {
self.0.keys.get().unwrap()
}
pub(crate) fn matrix(&self) -> MutexGuard<Matrix> {
self.0.matrix.lock().unwrap()
}
pub fn export_keymap(&self) -> KeyMap {
let mut map = BTreeMap::new();
let mut key_leds = BTreeMap::new();
for key in self.keys().iter() {
let scancodes = (0..self.layout().meta.num_layers as usize)
.map(|layer| key.get_scancode(layer).unwrap().1)
.collect();
map.insert(key.logical_name.clone(), scancodes);
if !key.leds.is_empty() {
key_leds.insert(key.logical_name.clone(), key.color());
}
}
let layers = self
.layers()
.iter()
.map(|layer| KeyMapLayer {
mode: *layer.mode.lock().unwrap(),
brightness: layer.brightness(),
color: layer.color(),
})
.collect();
KeyMap {
model: self.model().to_string(),
version: 1,
map,
key_leds,
layers,
}
}
pub async fn set_no_input(&self, no_input: bool) -> Result<(), String> {
self.thread_client()
.set_no_input(self.board(), no_input)
.await
}
pub(crate) fn downgrade(&self) -> WeakBoard {
WeakBoard(Arc::downgrade(&self.0))
}
}
impl WeakBoard {
pub fn upgrade(&self) -> Option<Board> {
Some(Board(self.0.upgrade()?))
}
}
pub fn is_launch_updated() -> Result<bool, String> {
use regex::bytes::Regex;
let stdout = Command::new("fwupdmgr")
.args(["get-updates", "--json"])
.output()
.map_err(|e| format!("Failed to use fwupdmgr: {}", e))?
.stdout;
static RE: Lazy<Regex> = Lazy::new(|| Regex::new("Launch.* Configurable Keyboard").unwrap());
Ok(!RE.is_match(&stdout))
}
================================================
FILE: backend/src/color.rs
================================================
use ordered_float::NotNan;
use palette::{Component, IntoColor, RgbHue};
use serde::{de, Deserialize, Serialize};
use std::{f64::consts::PI, fmt};
type PaletteHsv = palette::Hsv<palette::encoding::Srgb, f64>;
type PaletteLinSrgb = palette::LinSrgb<f64>;
/// Floating point hue/saturation color
#[cfg_attr(feature = "glib", derive(glib::Boxed))]
#[derive(
Clone, Copy, Debug, Serialize, Deserialize, Default, PartialEq, Hash, Eq, Ord, PartialOrd,
)]
#[cfg_attr(feature = "glib", boxed_type(name = "S76Hs"))]
pub struct Hs {
/// Hue, in radians
pub h: NotNan<f64>,
/// Saturation, from 0.0 to 1.0
pub s: NotNan<f64>,
}
impl Hs {
pub fn new(h: f64, s: f64) -> Self {
Self {
h: NotNan::new(h).unwrap(),
s: NotNan::new(s).unwrap(),
}
}
pub fn from_ints(h: u8, s: u8) -> Self {
Self::new(h.convert::<f64>() * (2. * PI), s.convert())
}
pub fn to_ints(self) -> (u8, u8) {
let h = (self.h / (2. * PI)).rem_euclid(1.);
(h.convert(), self.s.convert())
}
pub fn to_rgb(self) -> Rgb {
let hue = RgbHue::from_radians(*self.h);
let hsv = PaletteHsv::new(hue, *self.s, 1.);
let rgb: PaletteLinSrgb = hsv.into_rgb();
let (r, g, b) = rgb.into_components();
Rgb::from_floats(r, g, b)
}
}
/// Integer RGB color
#[cfg_attr(feature = "glib", derive(glib::Boxed))]
#[derive(Clone, Copy, Debug, Default)]
#[cfg_attr(feature = "glib", boxed_type(name = "S76Rgb"))]
pub struct Rgb {
/// Red
pub r: u8,
/// Green
pub g: u8,
/// Blue
pub b: u8,
}
impl Rgb {
pub fn new(r: u8, g: u8, b: u8) -> Self {
Self { r, g, b }
}
pub fn from_floats(r: f64, g: f64, b: f64) -> Self {
Self {
r: r.convert(),
g: g.convert(),
b: b.convert(),
}
}
pub fn to_floats(self) -> (f64, f64, f64) {
(self.r.convert(), self.g.convert(), self.b.convert())
}
/// Parse from hexadecimal string
pub fn parse(s: &str) -> Option<Self> {
if s.len() == 7 && s.starts_with('#') {
let r = u8::from_str_radix(&s[1..3], 16).ok()?;
let g = u8::from_str_radix(&s[3..5], 16).ok()?;
let b = u8::from_str_radix(&s[5..7], 16).ok()?;
Some(Self::new(r, g, b))
} else {
None
}
}
#[allow(clippy::many_single_char_names)]
pub fn to_hs_lossy(self) -> Hs {
let (r, g, b) = self.to_floats();
let rgb = PaletteLinSrgb::new(r, g, b);
let hsv: PaletteHsv = rgb.into_hsv();
let (h, s, _) = hsv.into_components();
Hs::new(h.to_radians(), s)
}
}
/// Convert to hexadecimal string
impl fmt::Display for Rgb {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "#{:02x}{:02x}{:02x}", self.r, self.g, self.b)
}
}
impl Serialize for Rgb {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_str(&self.to_string())
}
}
struct RgbVisitor;
impl<'de> de::Visitor<'de> for RgbVisitor {
type Value = Rgb;
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "a hexadecimal rgb code prefixed with #")
}
fn visit_str<E: de::Error>(self, v: &str) -> Result<Rgb, E> {
Rgb::parse(v).ok_or_else(|| E::invalid_value(de::Unexpected::Str(v), &self))
}
}
impl<'de> Deserialize<'de> for Rgb {
fn deserialize<D: de::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
deserializer.deserialize_str(RgbVisitor)
}
}
#[cfg(test)]
mod test {
use crate::*;
#[test]
fn test_hs_rgb_hs() {
let hs1 = Hs::new(0.3, 0.4);
let hs2 = hs1.to_rgb().to_hs_lossy();
let hs3 = hs2.to_rgb().to_hs_lossy();
assert!((hs1.h - hs2.h).abs() < 0.01);
assert!((hs1.s - hs2.s).abs() < 0.01);
assert!((hs2.h - hs3.h).abs() < 0.0001);
assert!((hs2.s - hs3.s).abs() < 0.0001);
}
}
================================================
FILE: backend/src/daemon/client.rs
================================================
use std::{
cell::RefCell,
env,
io::{BufRead, BufReader, Write},
path::PathBuf,
process::{Child, ChildStdin, ChildStdout, Command, Stdio},
};
use super::{err_str, Daemon, DaemonClientTrait, DaemonCommand, DaemonResponse};
pub struct DaemonClient {
child: Child,
read: RefCell<BufReader<ChildStdout>>,
write: RefCell<ChildStdin>,
}
impl DaemonClient {
pub fn new_pkexec() -> Self {
// Use canonicalized command name
let command_path = if cfg!(feature = "appimage") {
PathBuf::from(env::var("APPIMAGE").expect("Failed to get executable path"))
} else {
env::current_exe().expect("Failed to get executable path")
};
let mut child = Command::new("pkexec")
.arg(command_path)
.arg("--daemon")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.expect("Failed to spawn daemon");
let stdin = child.stdin.take().unwrap();
let mut stdout = BufReader::new(child.stdout.take().unwrap());
// Check if daemon has started
let mut line = String::new();
if let Ok(count) = stdout.read_line(&mut line) {
// pkexec terminated returning EOF
if count == 0 {
panic!("Failed to start daemon with pkexec");
}
}
Self {
child,
read: RefCell::new(stdout),
write: RefCell::new(stdin),
}
}
}
impl DaemonClientTrait for DaemonClient {
fn send_command(&self, command: DaemonCommand) -> Result<DaemonResponse, String> {
let mut command_json = serde_json::to_string(&command).map_err(err_str)?;
command_json.push('\n');
self.write
.borrow_mut()
.write_all(command_json.as_bytes())
.map_err(err_str)?;
let mut response_json = String::new();
self.read
.borrow_mut()
.read_line(&mut response_json)
.map_err(err_str)?;
serde_json::from_str(&response_json).map_err(err_str)?
}
}
impl Drop for DaemonClient {
fn drop(&mut self) {
let _ = self.exit();
let status = self.child.wait().expect("Failed to wait for daemon");
if !status.success() {
panic!("Failed to run daemon with exit status {:?}", status);
}
}
}
================================================
FILE: backend/src/daemon/daemon_thread.rs
================================================
use futures::{
channel::{mpsc as async_mpsc, oneshot},
executor::LocalPool,
future::{abortable, AbortHandle},
prelude::*,
task::LocalSpawnExt,
};
use futures_timer::Delay;
use once_cell::sync::Lazy;
use std::{
cell::{Cell, RefCell},
cmp::PartialEq,
collections::HashMap,
hash::{Hash, Hasher},
rc::Rc,
sync::{Arc, Mutex, Weak},
thread::{self, JoinHandle},
time::Duration,
};
use super::{Benchmark, BoardId, Daemon, Matrix, Nelson, NelsonKind};
use crate::{Board, BoardEvent, Bootloaded, Event};
#[derive(Clone, Debug)]
struct Item<K: Hash + Eq, V> {
key: K,
value: V,
}
impl<K: Hash + Eq, V> Item<K, V> {
fn new(key: K, value: V) -> Self {
Self { key, value }
}
}
impl<K: Hash + Eq, V> Hash for Item<K, V> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.key.hash(state);
}
}
impl<K: Hash + Eq, V> PartialEq for Item<K, V> {
fn eq(&self, other: &Self) -> bool {
self.key == other.key
}
}
impl<K: Hash + Eq, V> Eq for Item<K, V> {}
#[derive(Clone, Hash, Eq, PartialEq, Debug)]
enum SetEnum {
KeyMap(Item<(BoardId, u8, u8, u8), u16>),
Color(Item<(BoardId, u8), (u8, u8, u8)>),
Brightness(Item<(BoardId, u8), i32>),
Mode(Item<(BoardId, u8), (u8, u8)>),
Benchmark(BoardId),
Nelson(BoardId, NelsonKind),
LedSave(BoardId),
MatrixGetRate(Item<(), Option<Duration>>),
Refresh,
BootLoaderUpdate(Option<Bootloaded>),
NoInput(BoardId, bool),
Exit,
}
impl SetEnum {
fn is_cancelable(&self) -> bool {
!matches!(self, Self::Nelson(_, _) | Self::Benchmark(_))
}
}
#[derive(Debug)]
struct Set {
inner: SetEnum,
oneshot: oneshot::Sender<Result<Response, String>>,
}
#[derive(Debug)]
enum Response {
Benchmark(Benchmark),
Canceled,
Empty,
Nelson(Box<Nelson>),
}
impl From<Benchmark> for Response {
fn from(benchmark: Benchmark) -> Self {
Response::Benchmark(benchmark)
}
}
impl From<()> for Response {
fn from(_unit: ()) -> Self {
Response::Empty
}
}
impl From<Nelson> for Response {
fn from(nelson: Nelson) -> Self {
Response::Nelson(Box::new(nelson))
}
}
impl Set {
fn reply<T: Into<Response>>(self, resp: Result<T, String>) {
let _ = self.oneshot.send(resp.map(|x| x.into()));
}
}
#[derive(Debug)]
pub struct ThreadClient {
cancels: Mutex<HashMap<SetEnum, AbortHandle>>,
channel: async_mpsc::UnboundedSender<Set>,
join_handle: Mutex<Option<JoinHandle<()>>>,
}
impl ThreadClient {
pub fn new(
daemon: Box<dyn Daemon>,
event_sender: async_mpsc::UnboundedSender<Event>,
) -> Arc<Self> {
let (sender, reciever) = async_mpsc::unbounded();
let client = Arc::new(Self {
cancels: Mutex::new(HashMap::new()),
channel: sender,
join_handle: Mutex::new(None),
});
let join_handle = Thread::new(daemon, client.clone(), event_sender).spawn(reciever);
*client.join_handle.lock().unwrap() = Some(join_handle);
client
}
#[allow(clippy::await_holding_lock)]
async fn send(&self, set_enum: SetEnum) -> Result<Response, String> {
let (sender, receiver) = oneshot::channel();
let (receiver, cancel) = abortable(receiver);
{
let mut cancels = self.cancels.lock().unwrap();
if set_enum.is_cancelable() {
if let Some(cancel) = cancels.remove(&set_enum) {
cancel.abort();
}
}
cancels.insert(set_enum.clone(), cancel);
}
let _ = self.channel.unbounded_send(Set {
inner: set_enum,
oneshot: sender,
});
match receiver.await {
Ok(Ok(res)) => res,
_ => Ok(Response::Canceled),
}
}
async fn send_noresp(&self, set_enum: SetEnum) -> Result<(), String> {
self.send(set_enum).await.and(Ok(()))
}
pub async fn refresh(&self) -> Result<(), String> {
self.send_noresp(SetEnum::Refresh).await
}
pub async fn check_for_bootloader(&self) -> Result<(), String> {
use regex::bytes::Regex;
static HAS_USB_HUB: Lazy<Regex> =
Lazy::new(|| Regex::new("3384:000.*System76 USB").unwrap());
static ATMEGA32U4: Lazy<Regex> =
Lazy::new(|| Regex::new("03eb:2ff4.*atmega32u4.*bootloader").unwrap());
static AT90USB646: Lazy<Regex> =
Lazy::new(|| Regex::new("03eb:2ff9.*at90usb646.*bootloader").unwrap());
let lsusb = async_process::Command::new("lsusb")
.arg("--verbose")
.output()
.await
.map_err(|_| "Failed to run lsusb".to_string())?
.stdout;
let update = if AT90USB646.is_match(&lsusb) {
if HAS_USB_HUB.is_match(&lsusb) {
Some(Bootloaded::At90usb646)
} else {
Some(Bootloaded::At90usb646Lite)
}
} else if ATMEGA32U4.is_match(&lsusb) {
Some(Bootloaded::AtMega32u4)
} else {
None
};
self.send_noresp(SetEnum::BootLoaderUpdate(update)).await
}
pub async fn keymap_set(
&self,
board: BoardId,
layer: u8,
output: u8,
input: u8,
value: u16,
) -> Result<(), String> {
self.send_noresp(SetEnum::KeyMap(Item::new(
(board, layer, output, input),
value,
)))
.await
}
pub async fn set_color(
&self,
board: BoardId,
index: u8,
color: (u8, u8, u8),
) -> Result<(), String> {
self.send_noresp(SetEnum::Color(Item::new((board, index), color)))
.await
}
pub async fn set_brightness(
&self,
board: BoardId,
index: u8,
brightness: i32,
) -> Result<(), String> {
self.send_noresp(SetEnum::Brightness(Item::new((board, index), brightness)))
.await
}
pub async fn set_mode(
&self,
board: BoardId,
layer: u8,
mode: u8,
speed: u8,
) -> Result<(), String> {
self.send_noresp(SetEnum::Mode(Item::new((board, layer), (mode, speed))))
.await
}
pub async fn set_matrix_get_rate(&self, rate: Option<Duration>) -> Result<(), String> {
self.send_noresp(SetEnum::MatrixGetRate(Item::new((), rate)))
.await
}
pub async fn benchmark(&self, board: BoardId) -> Result<Benchmark, String> {
let resp = self.send(SetEnum::Benchmark(board)).await?;
if let Response::Benchmark(benchmark) = resp {
Ok(benchmark)
} else {
panic!("{}", format!("'{:?}' unexpected", resp));
}
}
pub async fn nelson(&self, board: BoardId, kind: NelsonKind) -> Result<Nelson, String> {
let resp = self.send(SetEnum::Nelson(board, kind)).await?;
if let Response::Nelson(nelson) = resp {
Ok(*nelson)
} else {
panic!("{}", format!("'{:?}' unexpected", resp));
}
}
pub async fn led_save(&self, board: BoardId) -> Result<(), String> {
self.send_noresp(SetEnum::LedSave(board)).await
}
pub async fn set_no_input(&self, board: BoardId, no_input: bool) -> Result<(), String> {
self.send_noresp(SetEnum::NoInput(board, no_input)).await
}
pub fn close(&self) {
let join_handle = match self.join_handle.lock().unwrap().take() {
Some(join_handle) => join_handle,
None => {
return;
}
};
// Send exit command to thread
let (sender, _receiver) = oneshot::channel();
let _ = self.channel.unbounded_send(Set {
inner: SetEnum::Exit,
oneshot: sender,
});
// Wait for thread to terminate
join_handle.join().unwrap();
}
}
/* TODO
BootloadedAdded(Bootloaded),
BootloadedRemoved
*/
struct ThreadBoard {
matrix: Arc<Mutex<Matrix>>,
board: BoardId,
event_sender: async_mpsc::UnboundedSender<Event>,
has_matrix: bool,
}
impl ThreadBoard {
fn new(
board: BoardId,
event_sender: async_mpsc::UnboundedSender<Event>,
has_matrix: bool,
matrix: Arc<Mutex<Matrix>>,
) -> Self {
Self {
matrix,
board,
event_sender,
has_matrix,
}
}
}
struct Thread {
daemon: Box<dyn Daemon>,
boards: RefCell<HashMap<BoardId, ThreadBoard>>,
client: Weak<ThreadClient>,
event_sender: async_mpsc::UnboundedSender<Event>,
matrix_get_rate: Cell<Option<Duration>>,
previous_bootloaded: RefCell<Option<Bootloaded>>,
current_bootloaded: RefCell<Option<Bootloaded>>,
}
impl Thread {
fn new(
daemon: Box<dyn Daemon>,
client: Arc<ThreadClient>,
event_sender: async_mpsc::UnboundedSender<Event>,
) -> Self {
Self {
daemon,
client: Arc::downgrade(&client),
event_sender,
boards: RefCell::new(HashMap::new()),
matrix_get_rate: Cell::new(None),
previous_bootloaded: RefCell::new(None),
current_bootloaded: RefCell::new(None),
}
}
fn spawn(self, mut channel: async_mpsc::UnboundedReceiver<Set>) -> JoinHandle<()> {
thread::spawn(move || {
let mut pool = LocalPool::new();
let spawner = pool.spawner();
let self_ = Rc::new(self);
let self_clone = self_.clone();
spawner
.spawn_local(async move {
loop {
if let Some(rate) = self_clone.matrix_get_rate.get() {
Delay::new(rate).await;
self_clone.matrix_refresh_all();
} else {
Delay::new(Duration::from_millis(100)).await;
}
}
})
.unwrap();
pool.run_until(async move {
while let Some(set) = channel.next().await {
if !self_.handle_set(set) {
break;
}
}
});
})
}
fn handle_set(&self, set: Set) -> bool {
if set.oneshot.is_canceled() && set.inner != SetEnum::Exit {
return true;
}
match set.inner {
SetEnum::KeyMap(Item { key, value }) => {
set.reply(self.daemon.keymap_set(key.0, key.1, key.2, key.3, value))
}
SetEnum::Color(Item { key, value }) => {
set.reply(self.daemon.set_color(key.0, key.1, value))
}
SetEnum::Brightness(Item { key, value }) => {
set.reply(self.daemon.set_brightness(key.0, key.1, value))
}
SetEnum::Mode(Item { key, value }) => {
set.reply(self.daemon.set_mode(key.0, key.1, value.0, value.1))
}
SetEnum::Benchmark(board) => set.reply(self.daemon.benchmark(board)),
SetEnum::Nelson(board, kind) => set.reply(self.daemon.nelson(board, kind)),
SetEnum::LedSave(board) => set.reply(self.daemon.led_save(board)),
SetEnum::MatrixGetRate(Item { value, .. }) => {
self.matrix_get_rate.set(value);
set.reply(Ok(()))
}
SetEnum::Refresh => set.reply(self.refresh()),
SetEnum::BootLoaderUpdate(update) => set.reply(self.bootloader_update(update)),
SetEnum::NoInput(board, no_input) => {
set.reply(self.daemon.set_no_input(board, no_input))
}
SetEnum::Exit => return false,
}
true
}
fn matrix_refresh_all(&self) {
for (k, v) in self.boards.borrow_mut().iter_mut() {
if !v.has_matrix {
continue;
}
let matrix = match self.daemon.matrix_get(*k) {
Ok(ok) => ok,
Err(err) => {
error!("failed to get matrix: {}", err);
continue;
}
};
let mut matrix_lock = v.matrix.lock().unwrap();
if *matrix_lock != matrix {
*matrix_lock = matrix;
let _ = v
.event_sender
.unbounded_send(Event::Board(v.board, BoardEvent::MatrixChanged));
}
}
}
fn bootloader_update(&self, update: Option<Bootloaded>) -> Result<(), String> {
*self.previous_bootloaded.borrow_mut() = *self.current_bootloaded.borrow();
*self.current_bootloaded.borrow_mut() = update;
// If a new board is plugged in and is in bootloader mode, update the gui
// only check if we are in launch test mode for production.
match (
*self.previous_bootloaded.borrow(),
*self.current_bootloaded.borrow(),
) {
(None, Some(board)) => {
let _ = self
.event_sender
.unbounded_send(Event::BootloadedAdded(board));
}
(Some(_), None) => {
let _ = self.event_sender.unbounded_send(Event::BootloadedRemoved);
}
_ => {}
}
Ok(())
}
fn refresh(&self) -> Result<(), String> {
self.daemon.refresh()?;
let mut boards = self.boards.borrow_mut();
let new_ids = self.daemon.boards()?;
// Removed boards
let event_sender = &self.event_sender;
boards.retain(|id, _| {
if !new_ids.iter().any(|i| i == id) {
let _ = event_sender.unbounded_send(Event::BoardRemoved(*id));
return false;
}
true
});
// Added boards
let mut have_new_board = false;
for i in &new_ids {
if boards.contains_key(i) {
continue;
}
if !have_new_board {
let _ = self.event_sender.unbounded_send(Event::BoardLoading);
have_new_board = true;
}
let matrix = Arc::new(Mutex::new(Matrix::default()));
match Board::new(
self.daemon.as_ref(),
self.client.upgrade().unwrap(),
*i,
matrix.clone(),
self.event_sender.clone(),
) {
Ok(board) => {
boards.insert(
*i,
ThreadBoard::new(*i, event_sender.clone(), board.has_matrix(), matrix),
);
let _ = self.event_sender.unbounded_send(Event::BoardAdded(board));
}
Err(err) => error!("Failed to add board: {}", err),
}
}
if have_new_board {
let _ = self.event_sender.unbounded_send(Event::BoardLoadingDone);
}
Ok(())
}
}
================================================
FILE: backend/src/daemon/dummy.rs
================================================
use std::{cell::RefCell, collections::HashMap};
use super::{BoardId, Daemon};
use crate::{fl, Benchmark, Layout, Matrix, Nelson, NelsonKind};
struct BoardDummy {
name: String,
layout: Layout,
keymap: RefCell<HashMap<(u8, u8, u8), u16>>,
colors: RefCell<HashMap<u8, (u8, u8, u8)>>,
brightnesses: RefCell<HashMap<u8, i32>>,
modes: RefCell<HashMap<u8, (u8, u8)>>,
}
impl BoardDummy {
fn valid_index(&self, index: u8, allow_key: bool) -> bool {
if !self.layout.meta.has_per_layer {
index == 0xff
} else if index >= 0xf0 {
index < 0xf0 + self.layout.meta.num_layers
} else {
allow_key && self.layout.leds.values().flatten().any(|i| *i == index)
}
}
}
pub struct DaemonDummy {
boards: Vec<BoardDummy>,
}
impl DaemonDummy {
pub fn new(board_names: Vec<String>) -> Result<Self, String> {
let mut boards = Vec::with_capacity(board_names.len());
for name in board_names {
if let Some(layout) = Layout::from_board(&name, "dummy") {
boards.push(BoardDummy {
layout,
name,
keymap: Default::default(),
colors: Default::default(),
brightnesses: Default::default(),
modes: Default::default(),
})
} else {
return Err(format!(
"'{name}' is an invalid board name. Might need a prefix, 'system76/{name}'?"
));
}
}
Ok(Self { boards })
}
fn board(&self, board: BoardId) -> Result<&BoardDummy, String> {
self.boards
.get(board.0 as usize)
.ok_or_else(|| fl!("no-board"))
}
}
impl Daemon for DaemonDummy {
fn boards(&self) -> Result<Vec<BoardId>, String> {
Ok((0..self.boards.len() as u128).map(BoardId).collect())
}
fn model(&self, board: BoardId) -> Result<String, String> {
Ok(self.board(board)?.name.clone())
}
fn version(&self, _board: BoardId) -> Result<String, String> {
Ok("1970-01-01-deadbee".to_string())
}
fn is_fake(&self) -> bool {
true
}
fn keymap_get(&self, board: BoardId, layer: u8, output: u8, input: u8) -> Result<u16, String> {
let keymap = self.board(board)?.keymap.borrow();
Ok(keymap.get(&(layer, output, input)).copied().unwrap_or(0))
}
fn keymap_set(
&self,
board: BoardId,
layer: u8,
output: u8,
input: u8,
value: u16,
) -> Result<(), String> {
let mut keymap = self.board(board)?.keymap.borrow_mut();
keymap.insert((layer, output, input), value);
Ok(())
}
fn matrix_get(&self, _board: BoardId) -> Result<Matrix, String> {
Ok(Matrix::new(0, 0, Vec::new().into_boxed_slice()))
}
fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
Err("Unimplemented".to_string())
}
fn nelson(&self, _board: BoardId, _kind: NelsonKind) -> Result<Nelson, String> {
Err("Unimplemented".to_string())
}
fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), String> {
let board = self.board(board)?;
if !board.valid_index(index, true) {
return Err(format!("Can't get color index {} {}", index, board.name));
}
Ok(*board.colors.borrow_mut().entry(index).or_default())
}
fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> Result<(), String> {
let board = self.board(board)?;
if !board.valid_index(index, true) {
return Err(format!("Can't set color index {}", index));
}
board.colors.borrow_mut().insert(index, color);
Ok(())
}
fn max_brightness(&self, _board: BoardId) -> Result<i32, String> {
Ok(100)
}
fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
let board = self.board(board)?;
if !board.valid_index(index, false) {
return Err(format!("Can't get brightness index {}", index));
}
Ok(*board.brightnesses.borrow_mut().entry(index).or_default())
}
fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> Result<(), String> {
let board = self.board(board)?;
if !board.valid_index(index, false) {
return Err(format!("Can't set brightness index {}", index));
}
board.brightnesses.borrow_mut().insert(index, brightness);
Ok(())
}
fn mode(&self, board: BoardId, layer: u8) -> Result<(u8, u8), String> {
let index = layer + 0xf0;
let board = self.board(board)?;
if !board.valid_index(index, false) {
return Err(format!("Can't get mode index {}", index));
}
Ok(*board.modes.borrow_mut().entry(index).or_default())
}
fn set_mode(&self, board: BoardId, layer: u8, mode: u8, speed: u8) -> Result<(), String> {
let index = layer + 0xf0;
let board = self.board(board)?;
if !board.valid_index(index, false) {
return Err(format!("Can't get mode index {}", index));
}
board.modes.borrow_mut().insert(index, (mode, speed));
Ok(())
}
fn led_save(&self, board: BoardId) -> Result<(), String> {
self.board(board)?;
Ok(())
}
fn refresh(&self) -> Result<(), String> {
Ok(())
}
fn set_no_input(&self, _board: BoardId, _no_input: bool) -> Result<(), String> {
Ok(())
}
fn exit(&self) -> Result<(), String> {
Ok(())
}
}
================================================
FILE: backend/src/daemon/mod.rs
================================================
use serde::{Deserialize, Serialize};
use crate::{Benchmark, Matrix, Nelson, NelsonKind};
mod client;
mod daemon_thread;
mod dummy;
mod server;
#[cfg(target_os = "linux")]
mod s76power;
#[cfg(target_os = "linux")]
pub use self::s76power::*;
pub use self::{client::*, daemon_thread::*, dummy::*, server::*};
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
pub struct BoardId(u128);
pub trait DaemonClientTrait: Send + 'static {
fn send_command(&self, command: DaemonCommand) -> Result<DaemonResponse, String>;
}
// Define Daemon trait, DaemonCommand enum, and DaemonResponse enum
macro_rules! commands {
( $( fn $func:ident(&self $(,)? $( $arg:ident: $type:ty ),*) -> Result<$ret:ty, String>; )* ) => {
pub trait Daemon: Send + 'static {
$(
fn $func(&self, $( $arg: $type ),*) -> Result<$ret, String>;
)*
fn is_fake(&self) -> bool {
false
}
fn dispatch_command_to_method(&self, command: DaemonCommand) -> Result<DaemonResponse, String> {
match command {
$(
DaemonCommand::$func{$( $arg ),*} => {
self.$func($( $arg ),*).map(DaemonResponse::$func)
}
)*
}
}
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize)]
#[serde(tag = "t", content = "c")]
pub enum DaemonCommand {
$(
$func{$( $arg: $type ),*}
),*
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize)]
#[serde(tag = "t", content = "c")]
pub enum DaemonResponse {
$(
$func($ret)
),*
}
impl<T: DaemonClientTrait> Daemon for T {
$(
fn $func(&self, $( $arg: $type ),*) -> Result<$ret, String> {
let res = self.send_command(DaemonCommand::$func{$( $arg ),*});
match res {
Ok(DaemonResponse::$func(ret)) => Ok(ret),
Ok(_) => unreachable!(),
Err(err) => Err(err),
}
}
)*
}
};
}
commands! {
fn boards(&self) -> Result<Vec<BoardId>, String>;
fn model(&self, board: BoardId) -> Result<String, String>;
fn version(&self, board: BoardId) -> Result<String, String>;
fn refresh(&self) -> Result<(), String>;
fn keymap_get(&self, board: BoardId, layer: u8, output: u8, input: u8) -> Result<u16, String>;
fn keymap_set(&self, board: BoardId, layer: u8, output: u8, input: u8, value: u16) -> Result<(), String>;
fn matrix_get(&self, board: BoardId) -> Result<Matrix, String>;
fn benchmark(&self, board: BoardId) -> Result<Benchmark, String>;
fn nelson(&self, board: BoardId, kind: NelsonKind) -> Result<Nelson, String>;
fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), String>;
fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> Result<(), String>;
fn max_brightness(&self, board: BoardId) -> Result<i32, String>;
fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String>;
fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> Result<(), String>;
fn mode(&self, board: BoardId, layer: u8) -> Result<(u8, u8), String>;
fn set_mode(&self, board: BoardId, layer: u8, mode: u8, speed: u8) -> Result<(), String>;
fn led_save(&self, board: BoardId) -> Result<(), String>;
fn set_no_input(&self, board: BoardId, no_input: bool) -> Result<(), String>;
fn exit(&self) -> Result<(), String>;
}
fn err_str<E: std::fmt::Debug>(err: E) -> String {
format!("{:?}", err)
}
================================================
FILE: backend/src/daemon/s76power.rs
================================================
// Note: Linux only
// Need to watch properties of each object?
// TODO: Hotplug detection support
use std::iter::Iterator;
use zbus::{blocking::fdo::ObjectManagerProxy, blocking::Connection, dbus_proxy};
use super::{err_str, BoardId, Daemon, Matrix};
use crate::{fl, Benchmark, Nelson, NelsonKind, Rgb};
const DBUS_NAME: &str = "com.system76.PowerDaemon";
#[dbus_proxy(
interface = "com.system76.PowerDaemon.Keyboard",
assume_defaults = true
)]
trait Keyboard {
#[dbus_proxy(property, name = "brightness")]
fn brightness(&self) -> zbus::Result<i32>;
#[dbus_proxy(property, name = "brightness")]
fn set_brightness(&self, value: i32) -> zbus::Result<()>;
#[dbus_proxy(property, name = "color")]
fn color(&self) -> zbus::Result<String>;
#[dbus_proxy(property, name = "color")]
fn set_color(&self, value: &str) -> zbus::Result<()>;
#[dbus_proxy(property, name = "max_brightness")]
fn max_brightness(&self) -> zbus::Result<i32>;
#[dbus_proxy(property, name = "name")]
fn name(&self) -> zbus::Result<String>;
}
struct Keyboard {
proxy: KeyboardProxyBlocking<'static>,
}
impl Keyboard {
fn new(path: &str) -> Result<Self, String> {
let connection = Connection::system().map_err(err_str)?;
let proxy = KeyboardProxyBlocking::builder(&connection)
.destination(DBUS_NAME.to_owned())
.map_err(err_str)?
.path(path.to_owned())
.map_err(err_str)?
.build()
.map_err(err_str)?;
Ok(Self { proxy })
}
}
pub struct DaemonS76Power {
boards: Vec<Keyboard>,
}
impl DaemonS76Power {
fn board(&self, board: BoardId) -> Result<&Keyboard, String> {
self.boards
.get(board.0 as usize)
.ok_or_else(|| fl!("no-board"))
}
}
impl DaemonS76Power {
pub fn new() -> Result<Self, String> {
let mut boards = Vec::new();
let connection = Connection::system().map_err(err_str)?;
let proxy = ObjectManagerProxy::builder(&connection)
.destination(DBUS_NAME)
.map_err(err_str)?
.path("/com/system76/PowerDaemon")
.map_err(err_str)?
.build()
.map_err(err_str)?;
let objects = proxy.get_managed_objects().map_err(err_str)?;
for path in objects.keys() {
if path.starts_with("/com/system76/PowerDaemon/keyboard") {
boards.push(Keyboard::new(path)?);
}
}
Ok(Self { boards })
}
}
impl Daemon for DaemonS76Power {
fn boards(&self) -> Result<Vec<BoardId>, String> {
Ok((0..self.boards.len() as u128).map(BoardId).collect())
}
fn model(&self, _board: BoardId) -> Result<String, String> {
// XXX
Ok("system76/darp6".to_string())
}
fn version(&self, _board: BoardId) -> Result<String, String> {
Err("Unimplemented".to_string())
}
fn keymap_get(
&self,
_board: BoardId,
_layer: u8,
_output: u8,
_input: u8,
) -> Result<u16, String> {
Err("Unimplemented".to_string())
}
fn keymap_set(
&self,
_board: BoardId,
_layer: u8,
_output: u8,
_input: u8,
_value: u16,
) -> Result<(), String> {
Err("Unimplemented".to_string())
}
fn matrix_get(&self, _board: BoardId) -> Result<Matrix, String> {
Err("Unimplemented".to_string())
}
fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
Err("Unimplemented".to_string())
}
fn nelson(&self, _board: BoardId, _kind: NelsonKind) -> Result<Nelson, String> {
Err("Unimplemented".to_string())
}
fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), String> {
if index != 0xFF {
return Err(format!("Can't set color index {}", index));
}
let color = self.board(board)?.proxy.color().map_err(err_str)?;
Ok(Rgb::parse(&color).map_or((0, 0, 0), |rgb| (rgb.r, rgb.g, rgb.b)))
}
fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> Result<(), String> {
if index != 0xFF {
return Err(format!("Can't set color index {}", index));
}
self.board(board)?
.proxy
.set_color(&Rgb::new(color.0, color.1, color.2).to_string())
.map_err(err_str)
}
fn max_brightness(&self, board: BoardId) -> Result<i32, String> {
self.board(board)?.proxy.max_brightness().map_err(err_str)
}
fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
if index != 0xFF {
return Err(format!("Can't set brightness index {}", index));
}
self.board(board)?.proxy.brightness().map_err(err_str)
}
fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> Result<(), String> {
if index != 0xFF {
return Err(format!("Can't set brightness index {}", index));
}
self.board(board)?
.proxy
.set_brightness(brightness)
.map_err(err_str)
}
fn mode(&self, _board: BoardId, _layer: u8) -> Result<(u8, u8), String> {
Err("Unimplemented".to_string())
}
fn set_mode(&self, _board: BoardId, _layer: u8, _mode: u8, _speed: u8) -> Result<(), String> {
Err("Unimplemented".to_string())
}
fn led_save(&self, _board: BoardId) -> Result<(), String> {
Err("Unimplemented".to_string())
}
fn refresh(&self) -> Result<(), String> {
Ok(())
}
fn set_no_input(&self, _board: BoardId, _no_input: bool) -> Result<(), String> {
Err("Unimplemented".to_string())
}
fn exit(&self) -> Result<(), String> {
Ok(())
}
}
================================================
FILE: backend/src/daemon/server.rs
================================================
#[cfg(target_os = "linux")]
use ectool::AccessLpcLinux;
use ectool::{Access, AccessHid, Ec};
use hidapi::{DeviceInfo, HidApi};
use std::{
cell::{Cell, RefCell, RefMut},
collections::HashMap,
io::{self, BufRead, BufReader, Read, Write},
str,
thread::sleep,
time::Duration,
};
use uuid::Uuid;
use super::{err_str, BoardId, Daemon, DaemonCommand};
use crate::{Benchmark, Matrix, Nelson, NelsonKind};
const QMK_RAW_USAGE_PAGE: u16 = 0xFF60;
const QMK_RAW_USAGE_ID: u16 = 0x61;
#[allow(clippy::type_complexity)]
pub struct DaemonServer<R: Read + Send + 'static, W: Write + Send + 'static> {
hidapi: RefCell<Option<HidApi>>,
running: Cell<bool>,
read: BufReader<R>,
write: W,
boards: RefCell<HashMap<BoardId, (Ec<Box<dyn Access>>, Option<DeviceInfo>)>>,
board_ids: RefCell<Vec<BoardId>>,
nelson: RefCell<Option<Ec<AccessHid>>>,
}
impl DaemonServer<io::Stdin, io::Stdout> {
pub fn new_stdio() -> Result<Self, String> {
Self::new(io::stdin(), io::stdout())
}
}
impl<R: Read + Send + 'static, W: Write + Send + 'static> DaemonServer<R, W> {
pub fn new(read: R, write: W) -> Result<Self, String> {
#[cfg_attr(not(target_os = "linux"), allow(unused_mut))]
let mut boards = HashMap::new();
#[cfg_attr(not(target_os = "linux"), allow(unused_mut))]
let mut board_ids = Vec::new();
#[cfg(target_os = "linux")]
match unsafe { AccessLpcLinux::new(Duration::new(1, 0)) } {
Ok(access) => match unsafe { Ec::new(access) } {
Ok(ec) => {
info!("Adding LPC EC");
let id = BoardId(Uuid::new_v4().as_u128());
boards.insert(id, (ec.into_dyn(), None));
board_ids.push(id);
}
Err(err) => {
error!("Failed to probe LPC EC: {:?}", err);
}
},
Err(err) => {
error!("Failed to access LPC EC: {:?}", err);
}
}
//TODO: should we continue through HID errors?
let hidapi = match HidApi::new() {
Ok(api) => Some(api),
Err(err) => {
error!("Failed to list USB HID ECs: {:?}", err);
None
}
};
Ok(Self {
hidapi: RefCell::new(hidapi),
running: Cell::new(true),
read: BufReader::new(read),
write,
boards: RefCell::new(boards),
board_ids: RefCell::new(board_ids),
nelson: RefCell::new(None),
})
}
fn have_device(&self, info: &DeviceInfo) -> bool {
for (_, i) in self.boards.borrow().values() {
if let Some(i) = i {
if (i.vendor_id(), i.product_id(), i.path())
== (info.vendor_id(), info.product_id(), info.path())
{
return true;
}
}
}
false
}
pub fn run(mut self) -> io::Result<()> {
println!("Daemon started");
while self.running.get() {
let mut command_json = String::new();
self.read.read_line(&mut command_json)?;
let command = serde_json::from_str::<DaemonCommand>(&command_json)
.expect("failed to deserialize command");
let response = self.dispatch_command_to_method(command);
//TODO: what to do if we fail to serialize result?
let mut result_json =
serde_json::to_string(&response).expect("failed to serialize result");
result_json.push('\n');
self.write.write_all(result_json.as_bytes())?;
}
Ok(())
}
fn board(&self, board: BoardId) -> Result<RefMut<Ec<Box<dyn Access>>>, String> {
let mut boards = self.boards.borrow_mut();
if boards.get_mut(&board).is_some() {
Ok(RefMut::map(boards, |x| &mut x.get_mut(&board).unwrap().0))
} else {
Err("failed to find board".to_string())
}
}
}
impl<R: Read + Send + 'static, W: Write + Send + 'static> Daemon for DaemonServer<R, W> {
fn boards(&self) -> Result<Vec<BoardId>, String> {
Ok(self.board_ids.borrow().clone())
}
fn model(&self, board: BoardId) -> Result<String, String> {
let mut ec = self.board(board)?;
let data_size = unsafe { ec.access().data_size() };
let mut data = vec![0; data_size];
let len = unsafe { ec.board(&mut data).map_err(err_str)? };
let board = str::from_utf8(&data[..len]).map_err(err_str)?;
Ok(board.to_string())
}
fn version(&self, board: BoardId) -> Result<String, String> {
let mut ec = self.board(board)?;
let data_size = unsafe { ec.access().data_size() };
let mut data = vec![0; data_size];
let len = unsafe { ec.version(&mut data).map_err(err_str)? };
let version = str::from_utf8(&data[..len]).map_err(err_str)?;
Ok(version.to_string())
}
fn keymap_get(&self, board: BoardId, layer: u8, output: u8, input: u8) -> Result<u16, String> {
let mut ec = self.board(board)?;
unsafe { ec.keymap_get(layer, output, input).map_err(err_str) }
}
fn keymap_set(
&self,
board: BoardId,
layer: u8,
output: u8,
input: u8,
value: u16,
) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe { ec.keymap_set(layer, output, input, value).map_err(err_str) }
}
fn matrix_get(&self, board: BoardId) -> Result<Matrix, String> {
let mut ec = self.board(board)?;
let data_size = unsafe { ec.access().data_size() };
let mut data = vec![0; data_size];
unsafe { ec.matrix_get(&mut data).map_err(err_str)? };
let rows = data.remove(0) as usize;
let cols = data.remove(0) as usize;
Ok(Matrix::new(rows, cols, data.into_boxed_slice()))
}
fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
Benchmark::new().map_err(err_str)
}
fn nelson(&self, board: BoardId, kind: NelsonKind) -> Result<Nelson, String> {
if let Some(nelson) = &mut *self.nelson.borrow_mut() {
const DELAY_MS: u64 = 200;
info!("Nelson delay is {} ms", DELAY_MS);
let delay = Duration::from_millis(DELAY_MS);
// Check if Nelson is already closed
if unsafe { nelson.led_get_value(0).map_err(err_str)?.0 > 0 } {
info!("Open Nelson");
unsafe { nelson.led_set_value(0, 0).map_err(err_str)? };
info!("Sleep");
sleep(delay);
}
info!("Close Nelson");
unsafe { nelson.led_set_value(0, 1).map_err(err_str)? };
info!("Sleep");
sleep(delay);
// Get pressed keys while nelson is closed
let matrix = self.matrix_get(board)?;
// Either missing or bouncing is set depending on test
let (mut missing, bouncing) = match kind {
NelsonKind::Normal => (matrix, Matrix::default()),
NelsonKind::Bouncing => (Matrix::default(), matrix),
};
// Missing must be inverted, since missing keys are not pressed
for row in 0..missing.rows() {
for col in 0..missing.cols() {
let value = missing.get(row, col).unwrap_or(false);
missing.set(row, col, !value);
}
}
info!("Open Nelson");
unsafe { nelson.led_set_value(0, 0).map_err(err_str)? };
info!("Sleep");
sleep(delay);
// Anything still pressed after nelson is opened is sticking
let sticking = self.matrix_get(board)?;
Ok(Nelson {
missing,
bouncing,
sticking,
})
} else {
Err("failed to find Nelson".to_string())
}
}
fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), String> {
let mut ec = self.board(board)?;
unsafe { ec.led_get_color(index) }.map_err(err_str)
}
fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe {
ec.led_set_color(index, color.0, color.1, color.2)
.map_err(err_str)
}
}
fn max_brightness(&self, board: BoardId) -> Result<i32, String> {
let mut ec = self.board(board)?;
let index = if unsafe { ec.access().is::<AccessHid>() } {
0xf0
} else {
0xff
};
unsafe { ec.led_get_value(index) }
.map(|x| i32::from(x.1))
.map_err(err_str)
}
fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
let mut ec = self.board(board)?;
unsafe {
ec.led_get_value(index)
.map(|x| i32::from(x.0))
.map_err(err_str)
}
}
fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe { ec.led_set_value(index, brightness as u8).map_err(err_str) }
}
fn mode(&self, board: BoardId, layer: u8) -> Result<(u8, u8), String> {
let mut ec = self.board(board)?;
unsafe { ec.led_get_mode(layer).map_err(err_str) }
}
fn set_mode(&self, board: BoardId, layer: u8, mode: u8, speed: u8) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe { ec.led_set_mode(layer, mode, speed).map_err(err_str) }
}
fn led_save(&self, board: BoardId) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe { ec.led_save().map_err(err_str) }
}
fn refresh(&self) -> Result<(), String> {
if let Some(api) = &mut *self.hidapi.borrow_mut() {
// Remove USB boards that are no longer attached
{
let mut boards = self.boards.borrow_mut();
let mut board_ids = self.board_ids.borrow_mut();
boards.retain(|_, (ec, _)| unsafe {
!(ec.access().is::<AccessHid>() && ec.probe().is_err())
});
board_ids.retain(|i| boards.contains_key(i));
}
if let Err(err) = api.refresh_devices() {
error!("Failed to refresh hidapi devices: {}", err);
}
for info in api.device_list() {
match (
info.vendor_id(),
info.product_id(),
info.interface_number(),
info.usage_page(),
info.usage(),
) {
// System76
(0x3384,
// launch_1
0x0001 |
// launch_lite_1
0x0005 |
// launch_2
0x0006 |
// launch_heavy_1
0x0007 |
// launch_3
0x0009 |
// launch_heavy_3
0x000A,
interface, usage_page, usage)
if is_qmk_raw_interface(interface, usage_page, usage) =>
{
// Skip if device already open
if self.have_device(info) {
continue;
}
match info.open_device(api) {
Ok(device) => match AccessHid::new(device, 10, 1000) {
Ok(access) => match unsafe { Ec::new(access) } {
Ok(ec) => {
info!("Adding USB HID EC at {:?}", info.path());
let id = BoardId(Uuid::new_v4().as_u128());
self.boards
.borrow_mut()
.insert(id, (ec.into_dyn(), Some(info.clone())));
self.board_ids.borrow_mut().push(id);
}
Err(err) => error!(
"Failed to probe USB HID EC at {:?}: {:?}",
info.path(),
err
),
},
Err(err) => error!(
"Failed to access USB HID EC at {:?}: {:?}",
info.path(),
err
),
},
Err(err) => {
error!("Failed to open USB HID EC at {:?}: {:?}", info.path(), err)
}
}
}
// System76 launch-nelson
(0x3384, 0x0002, 0, _, _) => {
if self.nelson.borrow().is_some() {
continue;
}
match info.open_device(api) {
Ok(device) => match AccessHid::new(device, 10, 1000) {
Ok(access) => match unsafe { Ec::new(access) } {
Ok(ec) => {
info!("Adding Nelson at {:?}", info.path());
*self.nelson.borrow_mut() = Some(ec);
}
Err(err) => error!(
"Failed to probe Nelson at {:?}: {:?}",
info.path(),
err
),
},
Err(err) => error!(
"Failed to access Nelson at {:?}: {:?}",
info.path(),
err
),
},
Err(err) => {
error!("Failed to open Nelson at {:?}: {:?}", info.path(), err)
}
}
}
_ => (),
}
}
}
Ok(())
}
fn set_no_input(&self, board: BoardId, no_input: bool) -> Result<(), String> {
let mut ec = self.board(board)?;
unsafe { ec.set_no_input(no_input) }.map_err(err_str)
}
fn exit(&self) -> Result<(), String> {
self.running.set(false);
Ok(())
}
}
// Getting the interface number isn't working on macOS 13.3
// (https://github.com/libusb/hidapi/pull/530)
// And `usage_page` and `usage` seem to have issues on Linux with older versions of `hidapi`.
fn is_qmk_raw_interface(interface: i32, usage_page: u16, usage: u16) -> bool {
if cfg!(target_os = "macos") {
(usage_page, usage) == (QMK_RAW_USAGE_PAGE, QMK_RAW_USAGE_ID)
} else {
interface == 1
}
}
================================================
FILE: backend/src/deref_cell.rs
================================================
use once_cell::unsync::OnceCell;
/// Wrapper around `OnceCell` implementing `Deref`, and thus also panicking
/// when not set (or set twice).
///
/// To be used in place of `gtk::TemplateChild`, but without xml.
pub struct DerefCell<T>(OnceCell<T>);
impl<T> DerefCell<T> {
pub fn is_some(&self) -> bool {
self.0.get().is_some()
}
#[track_caller]
pub fn set(&self, value: T) {
if self.0.set(value).is_err() {
panic!("Initialized twice");
}
}
}
impl<T> Default for DerefCell<T> {
fn default() -> Self {
Self(OnceCell::default())
}
}
impl<T> std::ops::Deref for DerefCell<T> {
type Target = T;
#[track_caller]
fn deref(&self) -> &T {
self.0.get().unwrap()
}
}
================================================
FILE: backend/src/key.rs
================================================
use std::sync::{
atomic::{AtomicU16, Ordering},
Mutex,
};
use crate::{Board, BoardEvent, Daemon, Hs, PhysicalLayoutKey, Rect, Rgb, WeakBoard};
#[derive(Debug)]
pub struct Key {
pub(crate) board: WeakBoard,
/// Logical position (row, column)
pub logical: (u8, u8),
/// Logical name (something like K01, where 0 is the row and 1 is the column)
pub logical_name: String,
/// Physical position and size
pub physical: Rect,
/// Physical key name (what is printed on the keycap)
pub physical_name: String,
/// Electrical mapping (output, input)
pub electrical: (u8, u8),
/// Electrical name (output, input)
pub electrical_name: String,
/// LED indexes
pub leds: Vec<u8>,
/// LED name
pub led_name: String,
led_color: Mutex<Option<Hs>>,
/// Currently loaded scancodes and their names
scancodes: Vec<AtomicU16>,
/// Background color
pub background_color: Rgb,
}
impl Key {
pub(crate) fn new(
daemon: &dyn Daemon,
board: &Board,
physical_key: &PhysicalLayoutKey,
) -> Self {
let logical = physical_key.logical;
let logical_name = physical_key.logical_name();
let physical = physical_key.physical;
let physical_name = physical_key.physical_name.clone();
let background_color = physical_key.background_color;
debug!("Key {}, {} = {:?}", physical.x, physical.y, physical_name);
debug!(" Logical: {:?}", logical);
debug!(" Logical Name: {}", logical_name);
let electrical = *board
.layout()
.layout
.get(logical_name.as_str())
//.expect("Failed to find electrical mapping");
.unwrap_or(&(0, 0));
debug!(" Electrical: {:?}", electrical);
let leds = board
.layout()
.leds
.get(logical_name.as_str())
.map_or(Vec::new(), |x| x.clone());
debug!(" LEDs: {:?}", leds);
let mut led_name = String::new();
for led in leds.iter() {
if !led_name.is_empty() {
led_name.push_str(", ");
}
led_name.push_str(&led.to_string());
}
let mut scancodes = Vec::new();
for layer in 0..board.layout().meta.num_layers {
debug!(" Layer {}", layer);
let scancode = match daemon.keymap_get(board.board(), layer, electrical.0, electrical.1)
{
Ok(value) => value,
Err(err) => {
error!("Failed to read scancode: {:?}", err);
0
}
};
debug!(" Scancode: {:04X}", scancode);
debug!(
" Scancode Name: {:?}",
board.layout().scancode_to_name(scancode)
);
scancodes.push(AtomicU16::new(scancode));
}
let mut led_color = None;
if board.layout().meta.has_mode && !leds.is_empty() {
match daemon.color(board.board(), leds[0]) {
Ok((0, 0, 0)) => {}
Ok((r, g, b)) => led_color = Some(Rgb::new(r, g, b).to_hs_lossy()),
Err(err) => error!("error getting key color: {}", err),
}
}
Self {
board: board.downgrade(),
logical,
logical_name,
physical,
physical_name,
electrical,
electrical_name: format!("{}, {}", electrical.0, electrical.1),
leds,
led_name,
led_color: Mutex::new(led_color),
scancodes,
background_color,
}
}
fn board(&self) -> Board {
self.board.upgrade().unwrap()
}
pub fn pressed(&self) -> bool {
self.board()
.matrix()
.get(self.electrical.0 as usize, self.electrical.1 as usize)
.unwrap_or(false)
}
pub fn color(&self) -> Option<Hs> {
*self.led_color.lock().unwrap()
}
pub async fn set_color(&self, color: Option<Hs>) -> Result<(), String> {
let board = self.board();
let Rgb { r, g, b } = color.map_or(Rgb::new(0, 0, 0), Hs::to_rgb);
for index in &self.leds {
board
.thread_client()
.set_color(board.board(), *index, (r, g, b))
.await?;
}
*self.led_color.lock().unwrap() = color;
board.set_leds_changed();
Ok(())
}
pub fn get_scancode(&self, layer: usize) -> Option<(u16, String)> {
let board = self.board();
let scancode = self.scancodes.get(layer)?.load(Ordering::SeqCst);
let scancode_name = match board.layout().scancode_to_name(scancode) {
Some(some) => some,
None => String::new(),
};
Some((scancode, scancode_name))
}
pub async fn set_scancode(&self, layer: usize, scancode_name: &str) -> Result<(), String> {
let board = self.board();
let scancode = board
.layout()
.scancode_from_name(scancode_name)
.ok_or_else(|| format!("Unable to find scancode '{}'", scancode_name))?;
board
.thread_client()
.keymap_set(
board.board(),
layer as u8,
self.electrical.0,
self.electrical.1,
scancode,
)
.await?;
self.scancodes[layer].store(scancode, Ordering::SeqCst);
board.send_event(BoardEvent::KeymapChanged);
Ok(())
}
}
================================================
FILE: backend/src/keymap.rs
================================================
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::{
collections::BTreeMap,
convert::TryFrom,
io::{Read, Write},
};
use crate::Hs;
mod hs_serde {
use super::*;
pub fn serialize<S: Serializer>(color: &Hs, serializer: S) -> Result<S::Ok, S::Error> {
color.to_ints().serialize(serializer)
}
pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result<Hs, D::Error> {
let (h, s) = <(u8, u8)>::deserialize(deserializer)?;
Ok(Hs::from_ints(h, s))
}
}
mod hs_map_serde {
use super::*;
pub fn serialize<S: Serializer>(
map: &BTreeMap<String, Option<Hs>>,
serializer: S,
) -> Result<S::Ok, S::Error> {
let map = map
.iter()
.map(|(k, hs)| (k, hs.map(|hs| hs.to_ints())))
.collect::<BTreeMap<_, _>>();
map.serialize(serializer)
}
pub fn deserialize<'de, D: Deserializer<'de>>(
deserializer: D,
) -> Result<BTreeMap<String, Option<Hs>>, D::Error> {
let map = <BTreeMap<String, Option<(u8, u8)>>>::deserialize(deserializer)?;
Ok(map
.into_iter()
.map(|(k, v)| (k, v.map(|(h, s)| Hs::from_ints(h, s))))
.collect())
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct KeyMapLayer {
pub mode: Option<(u8, u8)>,
pub brightness: i32,
#[serde(with = "hs_serde")]
pub color: Hs,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct KeyMap {
pub model: String,
pub version: u8,
pub map: BTreeMap<String, Vec<String>>,
#[serde(with = "hs_map_serde")]
pub key_leds: BTreeMap<String, Option<Hs>>,
pub layers: Vec<KeyMapLayer>,
}
impl KeyMap {
/// Parse layout from json file
pub fn from_reader<R: Read>(rdr: R) -> serde_json::Result<Self> {
serde_json::from_reader(rdr)
}
/// Write layout to json file, pretty printed
pub fn to_writer_pretty<W: Write>(&self, wtr: W) -> serde_json::Result<()> {
serde_json::to_writer_pretty(wtr, self)
}
/// Write layout to json string, pretty printed
pub fn to_string_pretty(&self) -> String {
serde_json::to_string_pretty(self).unwrap()
}
}
impl TryFrom<&str> for KeyMap {
type Error = serde_json::Error;
fn try_from(s: &str) -> Result<Self, serde_json::Error> {
serde_json::from_str(s)
}
}
================================================
FILE: backend/src/layer.rs
================================================
use std::sync::{
atomic::{AtomicI32, Ordering},
Mutex,
};
use crate::{Board, Daemon, Hs, Mode, Rgb, WeakBoard};
#[derive(Debug)]
pub struct Layer {
layer: u8,
index: u8,
board: WeakBoard,
pub(crate) mode: Mutex<Option<(u8, u8)>>,
brightness: AtomicI32,
color: Mutex<Hs>,
}
impl Layer {
pub(crate) fn new(daemon: &dyn Daemon, board: &Board, layer: u8) -> Self {
let index = if board.layout().meta.has_per_layer {
0xf0 + layer
} else {
0xff
};
let mode = if board.layout().meta.has_mode {
daemon
.mode(board.board(), layer)
.map(Some)
.unwrap_or_else(|err| {
error!("Error getting layer mode: {}", err);
None
})
} else {
None
};
let brightness = daemon
.brightness(board.board(), index)
.unwrap_or_else(|err| {
error!("error getting layer brightness: {}", err);
0
});
let color = daemon
.color(board.board(), index)
.map(|color| {
if index == 0xff {
Rgb::new(color.0, color.1, color.2).to_hs_lossy()
} else {
Hs::from_ints(color.0, color.1)
}
})
.unwrap_or_else(|err| {
error!("error getting layer color: {}", err);
Hs::new(0., 0.)
});
Self {
layer,
index,
board: board.downgrade(),
mode: Mutex::new(mode),
brightness: AtomicI32::new(brightness),
color: Mutex::new(color),
}
}
fn board(&self) -> Board {
self.board.upgrade().unwrap()
}
/// Get the current mode and speed. `None` if not supported by board.
pub fn mode(&self) -> Option<(&'static Mode, u8)> {
let (index, speed) = (*self.mode.lock().unwrap())?;
Some((Mode::from_index(index)?, speed))
}
pub async fn set_mode(&self, mode: &Mode, speed: u8) -> Result<(), String> {
let board = self.board();
board
.thread_client()
.set_mode(board.board(), self.layer, mode.index, speed)
.await?;
*self.mode.lock().unwrap() = Some((mode.index, speed));
board.set_leds_changed();
Ok(())
}
/// Get the current brightness
pub fn brightness(&self) -> i32 {
self.brightness.load(Ordering::SeqCst)
}
pub async fn set_brightness(&self, brightness: i32) -> Result<(), String> {
let board = self.board();
board
.thread_client()
.set_brightness(board.board(), self.index, brightness)
.await?;
self.brightness.store(brightness, Ordering::SeqCst);
board.set_leds_changed();
Ok(())
}
/// Get the current color
pub fn color(&self) -> Hs {
*self.color.lock().unwrap()
}
pub async fn set_color(&self, hs: Hs) -> Result<(), String> {
let board = self.board();
let color = if self.index == 0xff {
let Rgb { r, g, b } = hs.to_rgb();
(r, g, b)
} else {
let (h, s) = hs.to_ints();
(h, s, 0)
};
board
.thread_client()
.set_color(board.board(), self.index, color)
.await?;
*self.color.lock().unwrap() = hs;
board.set_leds_changed();
Ok(())
}
}
================================================
FILE: backend/src/layout/meta.rs
================================================
use crate::Rgb;
use serde::Deserialize;
fn num_layers_default() -> u8 {
2
}
/// Metadata for keyboard
#[derive(Debug, Deserialize)]
pub struct Meta {
/// Display name for keyboard
pub display_name: String,
/// Keyboard has per-key controllable LEDs supporting various modes
#[serde(default)]
pub has_mode: bool,
/// LED settings are per-layer, not for the whole keyboard
#[serde(default)]
pub has_per_layer: bool,
/// Has LED with brightness
pub has_brightness: bool,
/// Has LED with color (i.e. not monochrome)
pub has_color: bool,
/// Supports mod-tap bindings (assumes QMK mod-tap encoding)
#[serde(default)]
pub has_mod_tap: bool,
#[serde(default)]
/// Disable "Invert F Keys" option
pub no_fn_f: bool,
/// Number or layers; e.g. 2 where layer 2 is used when `Fn` is held
#[serde(default = "num_layers_default")]
pub num_layers: u8,
pub pressed_color: Rgb,
#[serde(default)]
pub is_qmk: bool,
}
================================================
FILE: backend/src/layout/mod.rs
================================================
use cascade::cascade;
use regex::Regex;
use std::{collections::HashMap, convert::TryFrom, fs, path::Path, str::FromStr};
mod meta;
use once_cell::sync::Lazy;
mod physical_layout;
pub use self::meta::Meta;
pub(crate) use physical_layout::{PhysicalLayout, PhysicalLayoutKey};
use crate::KeyMap;
// Merge date of https://github.com/system76/ec/pull/229
// Before this, `PAUSE` will not work.
const EC_PAUSE_DATE: (u16, u16, u16) = (2022, 5, 23);
// https://github.com/system76/ec/pull/263
const EC_FNLOCK_DATE: (u16, u16, u16) = (2023, 8, 1);
const QK_MOD_TAP_LEGACY: u16 = 0x6000;
const QK_MOD_TAP_MAX_LEGACY: u16 = 0x7FFF;
const QK_MOD_TAP: u16 = 0x2000;
const QK_MOD_TAP_MAX: u16 = 0x3FFF;
pub static MOD_TAP_MODS: Lazy<HashMap<&str, u16>> = Lazy::new(|| {
cascade! {
HashMap::new();
..insert("LEFT_CTRL", 0x01);
..insert("LEFT_SHIFT", 0x02);
..insert("LEFT_ALT", 0x04);
..insert("LEFT_SUPER", 0x08);
..insert("RIGHT_CTRL", 0x11);
..insert("RIGHT_SHIFT", 0x12);
..insert("RIGHT_ALT", 0x14);
..insert("RIGHT_SUPER", 0x18);
}
});
#[derive(Debug)]
pub struct Layout {
/// Metadata for keyboard
pub meta: Meta,
/// Default keymap for this keyboard
pub default: KeyMap,
keymap: HashMap<String, u16>,
scancode_names: HashMap<u16, String>,
pub(crate) physical: PhysicalLayout,
pub(crate) layout: HashMap<String, (u8, u8)>,
pub(crate) leds: HashMap<String, Vec<u8>>,
use_legacy_scancodes: bool,
}
macro_rules! keyboards {
($( ($board:expr, $keyboard:expr, $is_qmk:expr) ),* $(,)?) => {
fn layout_data(board: &str, use_legacy_scancodes: bool) -> Option<(&'static str, &'static str, &'static str, &'static str, &'static str, &'static str)> {
match board {
$(
$board => {
let meta_json =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/", $board, "/meta.json"));
let default_json =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/", $board, "/default.json"));
let keymap_json = if use_legacy_scancodes && $is_qmk {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keymap/qmk_legacy.json"))
} else if $is_qmk {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keymap/qmk.json"))
} else {
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keymap/ec.json"))
};
let layout_json =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keyboards/", $keyboard, "/layout.json"));
let leds_json =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keyboards/", $keyboard, "/leds.json"));
let physical_json =
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../layouts/keyboards/", $keyboard, "/physical.json"));
Some((meta_json, default_json, keymap_json, layout_json, leds_json, physical_json))
}
)*
_ => None
}
}
/// Names of board layouts that can be opened with `Layout::from_board`
pub fn layouts() -> &'static [&'static str] {
&[$( $board ),*]
}
};
}
// Calls the `keyboards!` macro
include!(concat!(env!("OUT_DIR"), "/keyboards.rs"));
impl Layout {
#[allow(clippy::too_many_arguments)]
pub fn from_data(
board: &str,
meta_json: &str,
default_json: &str,
keymap_json: &str,
layout_json: &str,
leds_json: &str,
physical_json: &str,
version: &str,
use_legacy_scancodes: bool,
) -> Self {
let meta: Meta = serde_json::from_str(meta_json).unwrap();
let mut default = KeyMap::try_from(default_json).unwrap();
let has_pause_scancode = if meta.is_qmk {
true
} else {
parse_ec_date(version).map_or(true, |date| date >= EC_PAUSE_DATE)
};
if !has_pause_scancode {
keymap_remove_pause(&mut default);
}
let has_fnlock_scancode = if meta.is_qmk {
false
} else {
parse_ec_date(version).map_or(true, |date| date >= EC_FNLOCK_DATE)
};
if !has_fnlock_scancode {
keymap_remove_fnlock(&mut default);
}
let (keymap, scancode_names) = parse_keymap_json(
keymap_json,
board,
&meta,
has_pause_scancode,
has_fnlock_scancode,
);
let layout = serde_json::from_str(layout_json).unwrap();
let leds = serde_json::from_str(leds_json).unwrap();
let physical = PhysicalLayout::from_str(physical_json);
Self {
meta,
default,
keymap,
scancode_names,
physical,
layout,
leds,
use_legacy_scancodes,
}
}
#[allow(dead_code)]
pub fn from_dir<P: AsRef<Path>>(board: &str, dir: P) -> Self {
let dir = dir.as_ref();
let meta_json =
fs::read_to_string(dir.join("meta.json")).expect("Failed to load meta.json");
let default_json =
fs::read_to_string(dir.join("default.json")).expect("Failed to load default.json");
let keymap_json =
fs::read_to_string(dir.join("keymap.json")).expect("Failed to load keymap.json");
let layout_json =
fs::read_to_string(dir.join("layout.json")).expect("Failed to load layout.json");
let leds_json =
fs::read_to_string(dir.join("leds.json")).expect("Failed to load leds.json");
let physical_json =
fs::read_to_string(dir.join("physical.json")).expect("Failed to load physical.json");
Self::from_data(
board,
&meta_json,
&default_json,
&keymap_json,
&layout_json,
&leds_json,
&physical_json,
"dummy",
false,
)
}
pub fn from_board(board: &str, version: &str) -> Option<Self> {
let use_legacy_scancodes = version.contains("0.7.103")
|| version.contains("0.7.104")
|| version.contains("0.12.20");
layout_data(board, use_legacy_scancodes).map(
|(meta_json, default_json, keymap_json, layout_json, leds_json, physical_json)| {
Self::from_data(
board,
meta_json,
default_json,
keymap_json,
layout_json,
leds_json,
physical_json,
version,
use_legacy_scancodes,
)
},
)
}
/// Get the scancode number corresponding to a name
pub fn scancode_to_name(&self, scancode: u16) -> Option<String> {
if self.meta.is_qmk {
let (qk_mod_tap, qk_mod_tap_max) = if self.use_legacy_scancodes {
(QK_MOD_TAP_LEGACY, QK_MOD_TAP_MAX_LEGACY)
} else {
(QK_MOD_TAP, QK_MOD_TAP_MAX)
};
if scancode >= qk_mod_tap && scancode < qk_mod_tap_max {
let mod_ = (scancode >> 8) & 0x1f;
let kc = scancode & 0xff;
let mod_name = MOD_TAP_MODS.iter().find(|(_, v)| **v == mod_)?.0;
let kc_name = self.scancode_names.get(&kc)?;
return Some(format!("MT({}, {})", mod_name, kc_name));
}
}
self.scancode_names.get(&scancode).cloned()
}
/// Get the name corresponding to a scancode number
pub fn scancode_from_name(&self, name: &str) -> Option<u16> {
if self.meta.is_qmk {
// Check if mod-tap
let mt_re = Regex::new("MT\\(([^()]+), ([^()]+)\\)").unwrap();
if let Some(captures) = mt_re.captures(name) {
let qk_mod_tap = if self.use_legacy_scancodes {
QK_MOD_TAP_LEGACY
} else {
QK_MOD_TAP
};
let mod_ = *MOD_TAP_MODS.get(&captures.get(1).unwrap().as_str())?;
let kc = *self.keymap.get(captures.get(2).unwrap().as_str())?;
return Some(qk_mod_tap | ((mod_ & 0x1f) << 8) | (kc & 0xff));
}
}
self.keymap.get(name).copied()
}
pub fn f_keys(&self) -> impl Iterator<Item = &str> {
self.default.map.iter().filter_map(|(k, v)| {
if let Some(num) = v[0].strip_prefix('F') {
if num.parse::<u8>().is_ok() {
return Some(k.as_str());
}
}
None
})
}
pub fn layout(&self) -> &HashMap<String, (u8, u8)> {
&self.layout
}
}
fn parse_keymap_json(
keymap_json: &str,
board: &str,
meta: &Meta,
has_pause_scancode: bool,
has_fnlock_scancode: bool,
) -> (HashMap<String, u16>, HashMap<u16, String>) {
let mut keymap: HashMap<String, u16> = serde_json::from_str(keymap_json).unwrap();
// Filter out keycodes that aren't relevant to this particular model
// TODO: Support bonw backlight over USB?
if meta.has_color || board == "system76/bonw14" || board == "system76/bonw15" {
keymap.remove("KBD_BKL");
} else if meta.has_brightness {
keymap.remove("KBD_COLOR");
} else {
for i in ["KBD_COLOR", "KBD_DOWN", "KBD_UP", "KBD_BKL", "KBD_TOGGLE"] {
keymap.remove(i);
}
}
if !has_pause_scancode {
keymap.remove("PAUSE");
}
if !has_fnlock_scancode {
keymap.remove("FNLOCK");
}
// Generate reverse mapping, from scancode to names
let mut scancode_names = HashMap::new();
for (scancode_name, scancode) in &keymap {
scancode_names.insert(*scancode, scancode_name.clone());
}
(keymap, scancode_names)
}
fn parse_ec_date(version: &str) -> Option<(u16, u16, u16)> {
let groups = Regex::new(r"^(\d+)-(\d+)-(\d+)_")
.unwrap()
.captures(version)?;
let mut groups = groups
.iter()
.skip(1)
.map(|g| u16::from_str(g.unwrap().as_str()).unwrap());
Some((
groups.next().unwrap(),
groups.next().unwrap(),
groups.next().unwrap(),
))
}
fn keymap_remove_pause(keymap: &mut KeyMap) {
for values in keymap.map.values_mut() {
if values.get(1).map(String::as_str) == Some("PAUSE") {
// Change `PAUSE` on layer 1 to match layer 0
values[1] = values[0].clone();
}
}
}
fn keymap_remove_fnlock(keymap: &mut KeyMap) {
for values in keymap.map.values_mut() {
if values.get(1).map(String::as_str) == Some("FNLOCK") {
// Change `FNLOCK` on layer 1 to match layer 0
values[1] = values[0].clone();
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::{collections::HashSet, fs, io};
const VERSIONS: [&str; 3] = ["0.7.103", "0.7.104", "0.19.12"];
#[test]
fn layout_from_board() {
for i in layouts() {
for version in VERSIONS {
Layout::from_board(i, version).unwrap();
}
}
}
#[test]
fn default_keys_exist() {
for i in layouts() {
for version in VERSIONS {
let mut missing = HashSet::new();
let layout = Layout::from_board(i, version).unwrap();
for j in layout.default.map.values().flatten() {
if !layout.keymap.keys().any(|x| x == j) {
missing.insert(j.to_owned());
}
}
assert_eq!(missing, HashSet::new(), "Mssing in keymap for {}", i);
}
}
}
#[test]
fn qmk_has_ec_keycodes() {
for version in VERSIONS {
let layout_ec = Layout::from_board("system76/darp6", version).unwrap();
let layout_qmk = Layout::from_board("system76/launch_1", version).unwrap();
for k in layout_ec.keymap.keys() {
if k == "KBD_COLOR"
|| k == "KBD_BKL"
|| k == "TOUCHPAD"
|| k == "DISPLAY_TOGGLE"
|| k == "DISPLAY_MODE"
|| k == "FAN_TOGGLE"
|| k == "CAMERA_TOGGLE"
|| k == "AIRPLANE_MODE"
|| k == "MIC_MUTE"
|| k == "FNLOCK"
{
continue;
}
assert_eq!(layout_qmk.keymap.keys().find(|x| x == &k), Some(k));
}
}
}
#[test]
fn color_brightness_keycodes() {
const VERSION: &str = "0.19.12";
let layout_no_color = Layout::from_board("system76/lemp10", VERSION).unwrap();
assert!(
layout_no_color.keymap.contains_key("KBD_BKL")
&& !layout_no_color.keymap.contains_key("KBD_COLOR")
);
let layout_color = Layout::from_board("system76/gaze15", VERSION).unwrap();
assert!(
layout_color.keymap.contains_key("KBD_COLOR")
&& !layout_color.keymap.contains_key("KBD_BKL")
);
let layout_bonw = Layout::from_board("system76/bonw14", VERSION).unwrap();
assert!(
layout_bonw.keymap.contains_key("KBD_COLOR")
&& !layout_bonw.keymap.contains_key("KBD_BKL")
);
}
#[test]
fn has_all_layouts_in_dir() -> io::Result<()> {
let layouts = layouts();
for i in fs::read_dir("../layouts/system76")? {
let i = i?;
if i.file_type()?.is_dir() {
let name = format!("system76/{}", i.file_name().into_string().unwrap());
assert!(
layouts.contains(&name.as_str()),
"{} not listed in {}",
name,
file!()
);
}
}
Ok(())
}
#[test]
fn physical_layout_leds_logical() {
for i in layouts() {
for version in VERSIONS {
let layout = Layout::from_board(i, version).unwrap();
let logical_in_physical = layout
.physical
.keys
.iter()
.map(|i| i.logical_name())
.collect::<HashSet<_>>();
let logical_in_layout = layout.layout.keys().cloned().collect::<HashSet<_>>();
let logical_in_leds = layout.layout.keys().cloned().collect::<HashSet<_>>();
assert_eq!(
&logical_in_physical - &logical_in_layout,
HashSet::new(),
"{}",
i
);
assert_eq!(
&logical_in_layout - &logical_in_physical,
HashSet::new(),
"{}",
i
);
assert_eq!(
&logical_in_physical - &logical_in_leds,
HashSet::new(),
"{}",
i
);
assert_eq!(
&logical_in_leds - &logical_in_physical,
HashSet::new(),
"{}",
i
);
}
}
}
#[test]
fn layout_has_f_keys() {
for i in layouts() {
if *i == "system76/launch_lite_1" {
continue;
}
for version in VERSIONS {
let layout = Layout::from_board(i, version).unwrap();
assert_eq!(layout.f_keys().count(), 12);
}
}
}
}
================================================
FILE: backend/src/layout/physical_layout.rs
================================================
//! Serde based deserialization for physical.json
//! From <http://www.keyboard-layout-editor.com>
use serde::Deserialize;
use std::char;
use crate::{Rect, Rgb};
#[allow(dead_code)]
#[derive(Debug)]
pub(crate) struct PhysicalLayout {
pub meta: PhysicalLayoutMeta,
pub keys: Vec<PhysicalLayoutKey>,
}
impl PhysicalLayout {
pub fn from_str(physical_json: &str) -> Self {
let json = serde_json::from_str::<PhysicalLayoutJson>(physical_json).unwrap();
let mut keys = Vec::new();
let mut row_i = 0;
let mut col_i = 0;
let mut physical = Rect::new(0.0, 0.0, 1.0, 1.0);
let mut background_color = Rgb::new(0xcc, 0xcc, 0xcc);
let mut meta = None;
for entry in json.0 {
match entry {
PhysicalLayoutEntry::Meta(data) => {
meta = Some(data);
}
PhysicalLayoutEntry::Row(row) => {
for i in &row.0 {
match i {
PhysicalKeyEnum::Meta(meta) => {
debug!("Key metadata {:?}", meta);
physical.x += meta.x;
physical.y -= meta.y;
physical.w = meta.w.unwrap_or(physical.w);
physical.h = meta.h.unwrap_or(physical.h);
background_color = meta.c.unwrap_or(background_color);
}
PhysicalKeyEnum::Name(name) => {
keys.push(PhysicalLayoutKey {
logical: (row_i as u8, col_i as u8),
physical,
physical_name: name.clone(),
background_color,
});
physical.x += physical.w;
physical.w = 1.0;
physical.h = 1.0;
col_i += 1;
}
}
}
physical.x = 0.0;
physical.y -= 1.0;
col_i = 0;
row_i += 1;
}
}
}
let meta = meta.expect("No layout meta");
Self { keys, meta }
}
}
#[derive(Debug)]
pub(crate) struct PhysicalLayoutKey {
pub logical: (u8, u8),
pub physical: Rect,
pub physical_name: String,
pub background_color: Rgb,
}
impl PhysicalLayoutKey {
pub fn logical_name(&self) -> String {
let row_char =
char::from_digit(u32::from(self.logical.0), 36).expect("Failed to convert row to char");
let col_char =
char::from_digit(u32::from(self.logical.1), 36).expect("Failed to convert col to char");
format!("K{}{}", row_char, col_char).to_uppercase()
}
}
#[derive(Debug, Deserialize)]
struct PhysicalLayoutJson(Vec<PhysicalLayoutEntry>);
#[derive(Debug, Deserialize)]
#[serde(untagged)]
enum PhysicalLayoutEntry {
Meta(PhysicalLayoutMeta),
Row(PhysicalRow),
}
#[derive(Debug, Deserialize)]
#[allow(dead_code)]
pub(crate) struct PhysicalLayoutMeta {
pub name: String,
pub author: String,
}
#[derive(Debug, Deserialize)]
struct PhysicalRow(Vec<PhysicalKeyEnum>);
#[derive(Debug, Deserialize)]
#[serde(untagged)]
enum PhysicalKeyEnum {
Name(String),
Meta(PhysicalKeyMeta),
}
#[derive(Debug, Deserialize)]
struct PhysicalKeyMeta {
#[serde(default)]
x: f64,
#[serde(default)]
y: f64,
w: Option<f64>,
h: Option<f64>,
c: Option<Rgb>,
}
================================================
FILE: backend/src/lib.rs
================================================
//#![warn(missing_docs)]
//! ```no_run
//! # use futures::{executor::ThreadPool, stream::StreamExt};
//! use system76_keyboard_configurator_backend::{Backend, Event};
//!
//! # let executor = ThreadPool::new().unwrap();
//!
//! let (backend, mut events) = Backend::new()?;
//! executor.spawn_ok(async move {
//! while let Some(event) = events.next().await {
//! if let Event::BoardAdded(board) = event {
//! println!("{}", board.model());
//! }
//! }
//! });
//! backend.refresh();
//! # Ok::<(), String>(())
//! ```
#[macro_use]
extern crate log;
mod backend;
mod benchmark;
mod board;
mod color;
mod daemon;
mod deref_cell;
mod key;
mod keymap;
mod layer;
mod layout;
mod localize;
mod matrix;
mod mode;
mod nelson;
mod rect;
pub use crate::daemon::BoardId;
use crate::daemon::*;
pub use crate::{
backend::*, benchmark::*, board::*, color::*, deref_cell::*, key::*, keymap::*, layer::*,
layout::*, localize::*, matrix::*, mode::*, nelson::*, rect::*,
};
================================================
FILE: backend/src/localize.rs
================================================
use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
};
use once_cell::sync::Lazy;
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "../i18n/"]
struct Localizations;
pub static LANGUAGE_LOADER: Lazy<FluentLanguageLoader> = Lazy::new(|| {
let loader: FluentLanguageLoader = fluent_language_loader!();
loader
.load_fallback_language(&Localizations)
.expect("Error while loading fallback language");
loader
});
#[macro_export]
macro_rules! fl {
($message_id:literal) => {{
i18n_embed_fl::fl!($crate::localize::LANGUAGE_LOADER, $message_id)
}};
($message_id:literal, $($args:expr),*) => {{
i18n_embed_fl::fl!($crate::localize::LANGUAGE_LOADER, $message_id, $($args), *)
}};
}
// Get the `Localizer` to be used for localizing this library.
pub fn localizer() -> Box<dyn Localizer> {
Box::from(DefaultLocalizer::new(&*LANGUAGE_LOADER, &Localizations))
}
================================================
FILE: backend/src/matrix.rs
================================================
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug, Default, PartialEq, Clone)]
pub struct Matrix {
rows: usize,
cols: usize,
data: Box<[u8]>,
}
impl Matrix {
pub fn new(rows: usize, cols: usize, data: Box<[u8]>) -> Self {
Self { rows, cols, data }
}
pub fn rows(&self) -> usize {
self.rows
}
pub fn cols(&self) -> usize {
self.cols
}
pub fn get(&self, row: usize, col: usize) -> Option<bool> {
if row < self.rows && col < self.cols {
let i = row * self.cols + col;
let byte = i / 8;
let bit = i % 8;
Some((self.data[byte] & (1 << bit)) != 0)
} else {
None
}
}
pub fn set(&mut self, row: usize, col: usize, value: bool) {
if row < self.rows && col < self.cols {
let i = row * self.cols + col;
let byte = i / 8;
let bit = i % 8;
if value {
self.data[byte] |= 1 << bit;
} else {
self.data[byte] &= !(1 << bit);
}
}
}
}
================================================
FILE: backend/src/mode.rs
================================================
use crate::fl;
use once_cell::sync::Lazy;
use std::collections::HashMap;
/// A mode/pattern for the keyboard's LEDs to display
#[non_exhaustive]
pub struct Mode {
/// Index (as used in firmware)
pub index: u8,
/// Textual ID of mode, for `ListBox` or debugging
pub id: &'static str,
/// Display name of mode
pub name: String,
/// Hue setting has effect in this mode
pub has_hue: bool,
/// Speed setting has effect in this mode
pub has_speed: bool,
}
impl Mode {
const fn new(
index: u8,
id: &'static str,
name: String,
has_hue: bool,
has_speed: bool,
) -> Self {
Self {
index,
id,
name,
has_hue,
has_speed,
}
}
/// Return slice of all `Mode`s, ordered as they should be displayed
pub fn all() -> &'static [Mode] {
&MODES
}
/// Get `Mode` corresponding to index (as used in firmware)
pub fn from_index(index: u8) -> Option<&'static Self> {
static MODE_BY_INDEX: Lazy<HashMap<u8, &Mode>> =
Lazy::new(|| MODES.iter().map(|i| (i.index, i)).collect());
MODE_BY_INDEX.get(&index).cloned()
}
/// Get `Mode` corresponding to textual ID
pub fn from_id(id: &str) -> Option<&'static Self> {
static MODE_BY_ID: Lazy<HashMap<&str, &Mode>> =
Lazy::new(|| MODES.iter().map(|i| (i.id, i)).collect());
MODE_BY_ID.get(&id).cloned()
}
/// `true` for Per Key mode, otherwise `false`
pub fn is_per_key(&self) -> bool {
self.index == 1
}
pub fn is_disabled(&self) -> bool {
self.index == 14
}
}
static MODES: Lazy<Vec<Mode>> = Lazy::new(|| {
vec![
Mode::new(14, "DISABLED", fl!("mode-disabled"), false, false),
Mode::new(0, "SOLID_COLOR", fl!("mode-solid-color"), true, false),
Mode::new(1, "PER_KEY", fl!("mode-per-key"), true, false),
Mode::new(13, "ACTIVE_KEYS", fl!("mode-active-keys"), true, false),
Mode::new(2, "CYCLE_ALL", fl!("mode-cycle-all"), false, true),
Mode::new(
3,
"CYCLE_LEFT_RIGHT",
fl!("mode-cycle-left-right"),
false,
true,
),
Mode::new(4, "CYCLE_UP_DOWN", fl!("mode-cycle-up-down"), false, true),
Mode::new(5, "CYCLE_OUT_IN", fl!("mode-cycle-out-in"), false, true),
Mode::new(
6,
"CYCLE_OUT_IN_DUAL",
fl!("mode-cycle-out-in-dual"),
false,
true,
),
Mode::new(
7,
"RAINBOW_MOVING_CHEVRON",
fl!("mode-rainbow-moving-chevron"),
false,
true,
),
Mode::new(8, "CYCLE_PINWHEEL", fl!("mode-cycle-pinwheel"), false, true),
Mode::new(9, "CYCLE_SPIRAL", fl!("mode-cycle-spiral"), false, true),
Mode::new(10, "RAINDROPS", fl!("mode-raindrops"), false, false),
Mode::new(11, "SPLASH", fl!("mode-splash"), false, true),
Mode::new(12, "MULTISPLASH", fl!("mode-multisplash"), false, true),
]
});
================================================
FILE: backend/src/nelson.rs
================================================
use serde::{Deserialize, Serialize};
use std::cmp;
use std::collections::HashMap;
use crate::Matrix;
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum NelsonKind {
Normal,
Bouncing,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct Nelson {
pub missing: Matrix,
pub bouncing: Matrix,
pub sticking: Matrix,
}
impl Nelson {
pub fn max_rows(&self) -> usize {
cmp::max(
self.missing.rows(),
cmp::max(self.bouncing.rows(), self.sticking.rows()),
)
}
pub fn max_cols(&self) -> usize {
cmp::max(
self.missing.cols(),
cmp::max(self.bouncing.cols(), self.sticking.cols()),
)
}
pub fn success(&self, layout: &HashMap<std::string::String, (u8, u8)>) -> bool {
let values: Vec<&(u8, u8)> = layout.values().collect();
for matrix in &[&self.missing, &self.bouncing, &self.sticking] {
for (row, col) in values.iter() {
if matrix.get(*row as usize, *col as usize).unwrap_or(false) {
return false;
}
}
}
true
}
}
================================================
FILE: backend/src/rect.rs
================================================
#[derive(Copy, Clone, Debug)]
pub struct Rect {
pub x: f64,
pub y: f64,
pub w: f64,
pub h: f64,
}
impl Rect {
pub fn new(x: f64, y: f64, w: f64, h: f64) -> Self {
Self { x, y, w, h }
}
/// Test if `(x, y)` is a point in the rectangle
pub fn contains(&self, x: f64, y: f64) -> bool {
(self.x..=self.x + self.w).contains(&x) && (self.y..=self.y + self.h).contains(&y)
}
}
================================================
FILE: build.rs
================================================
fn main() {
glib_build_tools::compile_resources(
&["data"],
"data/com.system76.keyboardconfigurator.gresource.xml",
"compiled.gresource",
);
}
================================================
FILE: data/com.system76.keyboardconfigurator.gresource.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/system76/keyboardconfigurator">
<file>icons/scalable/apps/com.system76.keyboardconfigurator.svg</file>
<file>icons/scalable/status/launch-keyboard-not-found.svg</file>
</gresource>
</gresources>
================================================
FILE: data/system76_launch_1_default.hex
================================================
:100000000C9458030C949F030C949F030C949F032F
:100010000C949F030C949F030C949F030C949F03D8
:100020000C949F030C949F030C94912C0C94462BDE
:100030000C94E11A0C949F030C949F030C949F035F
:100040000C949F030C949F030C949F030C949F03A8
:100050000C949F030C94AF1A0C949F030C949F0371
:100060000C949F030C949F030C949F030C949F0388
:100070000C949F030C949F030C949F030C949F0378
:100080000C949F030C949F030C949F030C949F0368
:100090000C949F030C949F030C949F030C949F0358
:1000A0000C949F030C949F030C949F0395079E0749
:1000B000D10715085B08A508F108F408F908FC0841
:1000C0000109040909090C090F0912091509180980
:1000D0001B091E092109240927092C096809A409FB
:1000E000A709AC09B709BA09C509C809D309D609CE
:1000F000E109E409EF09F5096D0ABA0AB80BBE0B6C
:10010000C30B5E0D5E0DCC0B5E0D5E0DD60BE70BCB
:100110000D0C2C0C4D0C7F0CAE0CD60C090D010DEA
:10012000540D98179817D217D2172518C819C8193F
:10013000C81941181F19301930199B1C9B1CAE1C83
:10014000AE1CA41CAE1CAE1CAE1C9B1C9B1CA91C94
:10015000AE1CAE1CA91C33245A2401265A240126A5
:10016000A624C9240126BE25CE2529003A003B003D
:100170003C003D003E003F00400041004200430083
:10018000440045004C0035001E001F0020002100E7
:100190002200230024002500260027002D002E0029
:1001A0002A002B0014001A000800150017001C007C
:1001B00018000C00120013002F003000310039002D
:1001C00004001600070009000A000B000D000E00D5
:1001D0000F003300340028004A00E1001D001B001E
:1001E0000600190005001100100036003700380025
:1001F000E50052004B00E000E2000151E3002C005A
:100200004D002C00E400E6000151500051004F0069
:100210004E00005C0100010001000100010001002E
:1002200001000100010001000100010001000100C6
:1002300001000100010001000100010001000100B6
:100240000100C35CCB5CCA5C0100460001000100F8
:100250000100010001004A004E004B004D0001006A
:100260000100010001000100010001000100010086
:1002700001005000510052004F0001000100010038
:10028000AE000100010001000100010001000100B9
:10029000010001000100010001004B00A900010064
:1002A0000100010001000100A8000100010001009F
:1002B00001004A004E004D00AA00010001000100AB
:1002C0000100010001000100010001000100010026
:1002D0000100010001000100010001000100010016
:1002E0000100010001000100010001000100010006
:1002F00001000100010001000100010001000100F6
:1003000001000100010001000100010001000100E5
:1003100001000100010001000100010001000100D5
:1003200001000100010001000100010001000100C5
:1003300001000100010001000100010001000100B5
:1003400001000100010001000100010001000100A5
:100350000100010001000100010001000100010095
:100360000100010001000100010001000100010085
:100370000100010001000100010001000100010075
:100380000100010001000100010001000100010065
:100390000100010001000100010001000100010055
:1003A0000100010001000100010001000100010045
:1003B0000100010001000100010001000100010035
:1003C0000100010001000100010001000100010025
:1003D0000100010001000100010001000100010015
:1003E0000100010001000100010001000100010005
:1003F00001000100010001000100010001000100F5
:1004000001000100010001000100000101010101E2
:1004100001010101020202020202020202030303BD
:10042000030303030304040404040404050505058D
:10043000050606060606070707070708080808094D
:100440000909090A0A0A0B0B0B0C0C0C0D0D0D0EF9
:100450000E0E0F0F0F10101111111212131314148E
:10046000151516161717181819191A1A1B1B1C1D03
:100470001D1E1E1F2020212222232424252626275C
:100480002829292A2B2C2D2D2E2F3031323233348E
:1004900035363738393A3B3C3D3E3F404142434494
:1004A00045464748494A4C4D4E4F50515354555676
:1004B00058595A5B5D5E5F616264656668696B6C22
:1004C0006D6F7072737577787A7B7D7E808283859D
:1004D00087888A8C8E8F91939596989A9C9EA0A2DD
:1004E000A3A5A7A9ABADAFB1B3B5B7BABCBEC0C2E7
:1004F000C4C6C9CBCDCFD1D4D6D8DBDDDFE2E4E7AB
:10050000E9EBEEF0F3F5F8FAFDFF05010980A10132
:10051000850319012AB700150126B700950175104A
:100520008100C0050C0901A101850419012AA0025E
:10053000150126A002950175108100C0050109066C
:10054000A1018505050719E029E715002501950892
:10055000750181020507190029EF1500250195F0A5
:10056000750181020508190129059505750191029A
:10057000950175039101C00660FF0961A10109623F
:10058000150026FF009520750881020963150026D5
:10059000FF00952075089102C005010906A101051B
:1005A0000719E029E71500250195087501810295D5
:1005B00001750881010507190029FF150026FF00B4
:1005C000950675088100050819012905950575012D
:1005D0009102950175039101C009025B00030100BE
:1005E000A0FA090400000103010100092111010022
:1005F000012240000705810308000A0904010002E6
:1006000003000000092111010001222200070582D8
:100610000320000107050303200001090402000173
:1006200003000000092111010001226D000705846B
:100630000320000A120110010000000884330100A9
:1006400001000102000150034C00610075006E00C2
:1006500063006800200043006F006E0066006900C0
:10066000670075007200610062006C006500200088
:100670004B006500790062006F0061007200640049
:10068000200028006C00610075006E0063006800A7
:100690005F0031002900000012035300790073004D
:1006A000740065006D003700360000000403090483
:1006B00011241FBECFEFDAE0DEBFCDBF04B603FECC
:1006C00027C08091080790910907A0910A07B0916F
:1006D0000B078730904BA740B04BD1F4109208071E
:1006E0001092090710920A0710920B0714BE84B7E4
:1006F000877F84BF0FB6F894A895809160008861C9
:1007000080936000109260000FBEE0E0F8E309956E
:1007100013E0A0E0B1E0E2E9F0E602C005900D923E
:10072000AA34B107D9F727E0AAE4B3E001C01D92CB
:10073000A830B207E1F70E94A1030C9447300C9453
:100740000000CF93DF93CDB7DEB7AD970FB6F89427
:10075000DEBF0FBECDBF84B7877F84BF0FB6F894CE
:10076000A89580916000886180936000109260007D
:100770000FBE91E080E80FB6F894809361009093EB
:1007800061000FBE85B7806885BF85B7806885BF6B
:100790008EE09AE190934B0380934A030E948A2B48
:1007A0000E94302C8091E20084608093E200789473
:1007B0008091CB068823A1F01091E9001F709091E1
:1007C000EC00892F817090FD80E8182B1092E900D1
:1007D0008091E80083FD0E944D231F701093E90073
:1007E00082E084BD93E095BD9DE797BD80936E0048
:1007F00009E711E07FE7E72E71E0F72ED8018D9130
:100800008D010E946226E016F106C1F70FE711E0A4
:100810006DE8E62E61E0F62EF80181918F010E94CD
:100820006226E016F106C1F7ECE4F3E088E593E018
:10083000A7EFB3E0119211921D921D928E179F07A0
:10084000C9F780E090E00E94642F8B3E9E4F11F02C
:100850000E94781B1092D506EEEEF6E08EEF96E041
:100860002FEF3FEF219331938E179F07D9F7109207
:100870005D03E6E7F3E08FEF9FEF8193919323E031
:10088000E638F207D1F780E090E00E94642F8B3EBB
:100890009E4F21F00E94781B0E94471245E050E0D5
:1008A0006CE170E082E097E00E944C2F809102079B
:1008B0008C7F11F40E9447121092BA0080E280935C
:1008C000B8001092BC008CE08CA701E010E09E0103
:1008D000245D3F4F4AEF50E360E87FEB8AE391E00D
:1008E0000E94872997FD4CC01BA69E01255D3F4FA6
:1008F00042E154E362ED7FEB8AE391E00E948729B5
:1009000097FD3EC019821A821B821C829E012F5FB6
:100910003F4F48E054E362ED7FEB8AE391E00E94B1
:10092000EE1F97FD2DC009811A812B813C8101604A
:1009300009831A832B833C8348E054E362ED7FEB09
:100940008AE391E00E94DF2997FD1AC004E813E3CF
:1009500023E030E040E050E360E87FEB8AE391E0A1
:100960000E94DF2997FD0CC004E813E324E030E087
:1009700048E455EE62ED7FEB8AE391E00E94DF29C7
:100980001FEF1093460180914701909148010E940A
:10099000932A0E9476201093150180911601909160
:1009A00017010E94932A10931101809112019091D6
:1009B00013010E94932A8091490190914A01A091CC
:1009C0004B0189839A83AB8343E050E0BE016F5FA4
:1009D0007F4F80913A010E94502904E610E00E9466
:1009E00076208FE19EE40197F1F700C000000150EE
:1009F0001109A9F70E94DA13AFE0B7E21197F1F7F6
:100A000000C00000EFE0F7E23197F1F700C000000E
:100A10000E94DA138091F70380FF13C06FEF7FEF1E
:100A200080E490E00E94982F6FEF82E490E00E94B3
:100A30007A2F6FEF7FEF80E090E00E94982F0E9466
:100A40008B1A80E490E00E94642F8C3E964739F424
:100A500082E490E00E945C2F91E0823009F090E007
:100A600090FD39C000E010E0780158EAE50EF11C75
:100A700058012CE1A20EB11CF801E659FE4FC590B9
:100A8000D4906D2DC8018D5B9F4F0E947A2F6C2DE5
:100A9000C8018C5B9F4F0E947A2F0E5F1F4FA016DC
:100AA000B10651F78501EA14FB0411F7870130EA1A
:100AB000E31632E0F306C1F681E00E94282B6CEECB
:100AC00076E780E490E00E94982F62E082E490E074
:100AD0000E947A2F03C080E00E94282B60910005BD
:100AE0007091010580910205909103050E94FC2AF6
:100AF00080E090E00E94642F8B3E9E4F11F00E9498
:100B0000781B82E090E00E945C2F8093EA030E94B1
:100B1000671B909359038093580383E090E00E94F1
:100B20005C2F682F70E080E090E00E947E1D609155
:100B300000057091010580910205909103050E94C6
:100B4000FC2A609158036068609358031091590320
:100B500084E090E00E947A2F612F81E290E00E9471
:100B60007A2F8FE291E090935B0380935A032224C3
:100B70002394312C8091CB06853009F053C040E49A
:100B8000F42EEE24E39400E112E18091CB0685304F
:100B900009F042C08091CB06843051F140E060E022
:100BA00080E00E944312E092E80310925C0388E127
:100BB00090E00FB6F894A895809360000FBEF09275
:100BC000600083B7817F846083BF83B7816083BF08
:100BD0007894889583B78E7F83BF0FB6F894A895D5
:100BE00080916000886180936000109260000FBE69
:100BF0008091CA06882309F4C8CF0E94DA13E7EF70
:100C0000F3E081919191892B09F090C7A3E0B4E0C2
:100C1000AE17BF07B1F7B9CF0E94AD1F0E946D118B
:100C20001092E8030E94DA13882359F08FB7F894E2
:100C30004091E4035091E5036091E6037091E7036E
:100C40008FBFABEEB3E0E7EFF3E0E12CF12C4E2DDC
:100C5000A190B1908D919D918A259B25009709F4D3
:100C6000AEC010E0CC24C394D12C9C012C213D219A
:100C7000232B09F49EC019A34AA3AC20BD2081E018
:100C8000A114B10409F480E08BA30E94D51A8160FD
:100C9000782F9DA38CA349A15AA16BA18DA10E947D
:100CA000A310F701EE0FFF1FE551FC4F80819181EA
:100CB000C826D926D182C082AB2889F08EE08E9DCD
:100CC000F0018F9DF00D1124E753FE4FE10FF11D50
:100CD00080818F3F21F08DA7DD24D39401C0D12CDA
:100CE000C0905D03ED2CF12CC7018C0D911D09976F
:100CF0009CF108E010E00E191F09B7016F5F7F4FEC
:100D0000635A7C4FA8018EE593E00E942F30B70113
:100D1000675F7F4F635A7C4FA80186E693E00E948D
:100D20002F30A801440F551FB701660F771F675E6C
:100D30007F4F635A7C4F86E793E00E942F30B701C4
:100D40006F5E7F4F635A7C4FA8018EE693E00E944E
:100D50002F30CA94C0925D0380915D0390E0EDA5B1
:100D6000AE2FB0E09D01220F331F235E3D4FAA0F2F
:100D7000BB1FBD01625E7D4F41E0480F9D15B0F481
:100D800090E0FC01E35AFC4FD9015C915183DB01F7
:100D90005C915187BDA5B18B880F991FFC01E35A67
:100DA000FC4F128E118E91E0842FE6CF80935D036D
:100DB0001EC01F5FCC0CDD1C1E3009F056CF2FEF7C
:100DC000E21AF20A36E0E316F10409F040CF8FEFA1
:100DD0008EA38FA318A60E94D51A8160782F9AA798
:100DE00089A74EA15FA168A58AA50E94A310409182
:100DF00086035091870360918803709189032FB710
:100E0000F8948091E4039091E503A091E603B091FA
:100E1000E7032FBF841B950BA60BB70B2FB7F894D6
:100E2000C090E403D090E503E090E603F090E70380
:100E30002FBFC0928603D0928703E0928803F0927E
:100E4000890360915D03EDE5F3E0462F50E0442413
:100E50004A94542C612C712C481A590A6A0A7B0A4C
:100E6000651799F0218D328D4901A12CB12C4814C0
:100E700059046A047B0410F4415004C0280F391F40
:100E8000328F218F5F5F3296EBCF40935D0380916D
:100E9000E803811108C010910207812F837019F0B7
:100EA0001695169501C010E080911A018130E9F085
:100EB00038F0823009F4DFC3833009F4E9C305C494
:100EC00010924201C092FE06D092FF06E092000707
:100ED000F092010789E2EDE5F3E0A5EDB6E00190BF
:100EE0000D928A95E1F781E0D0C380911901181322
:100EF0000DC020910207237030E04091180150E0AE
:100F000081E02417350719F480E001C081E0817089
:100F100080934401412F50E04832510508F099C3B5
:100F2000FA01EA5AFF4F0C942930882309F491C33F
:100F300040E060E080E00E9443128BC300914201D8
:100F400081E1089F002D112421E1F22EF00E54E5DD
:100F50005F1510F494E5F92E609103077091040772
:100F6000809105070E94E212E62ED72EC82E0F159B
:100F700090F4E02FF0E0DF01AB53BD4F8C919091E6
:100F80004301982331F02C2D4E2D6D2DCF010E9461
:100F900045120F5FECCF81E063E56F1508F05AC38F
:100FA00058C30091420181E1089F002D112481E185
:100FB000F82EF00E74E57F1510F4B4E5FB2ED090FA
:100FC0000407E0900507C0900307B6018E2D0E942C
:100FD000E212B62EA72E782E609106076C0D7D2D9D
:100FE0008E2D0E94E212E62ED72EC82E0F15B8F4D1
:100FF000802F90E0FC01EB53FD4F308120914301A5
:10100000232359F030FF04C02C2D4E2D6D2D03C02D
:10101000272D4B2D6A2D0E9445120F5FE7CF81E0EF
:1010200093E59F1508F016C314C30091420181E1B6
:10103000089F002D1124A1E1DA2ED00EA4E5AD15F4
:1010400010F4F4E5DF2EB0900407A090050720917E
:101050000607E0E4CE2E3C2D329F312D1124C32E05
:101060000D1518F5E02EF12CF701EB53FD4F908193
:10107000809143018923B9F0F701EE0FFF1FE25E73
:10108000FD4F808182958F70609103078C9D600D6C
:1010900011247B2D8A2D0E94E212462F282F672FC4
:1010A000C7010E9445120F5FDBCF81E053E55D155C
:1010B00008F0D0C2CEC20091420181E1089F002D0C
:1010C000112461E1D62ED00E64E56D1510F454E5BF
:1010D000D52EB0900407A09005072091060740E4A4
:1010E000C42E7C2D729F712D1124C72E0D1538F53D
:1010F000E02EF12CF701EB53FD4F908180914301DD
:101100008923D9F0F701EE0FFF1FE35EFD4F6081E9
:10111000C69EB001112435E0759567953A95E1F7C3
:1011200080910307680F7B2D8A2D0E94E212462FC3
:10113000282F672FC7010E9445120F5FD7CF81E08C
:1011400093E59D1508F086C284C20091420181E1B9
:10115000089F002D112491E1F92EF00EA4E5AF15A2
:1011600010F484E5F82ED0900307E0900407C090B7
:101170000507609106076695669566958091FE065F
:101180009091FF060E94D8120E945D12805887FD40
:101190008195880F282F3C2D239F212D1124822FEC
:1011A0006D2D7E2D0E94E212E62ED72EC82E0F1531
:1011B00090F4E02FF0E0DF01AB53BD4F8C919091A4
:1011C0004301982331F02C2D4E2D6D2DCF010E941F
:1011D00045120F5FECCF81E053E55F1508F03AC28E
:1011E00038C28BE89FE002C08FE59FE00E94732128
:1011F00031C284E690E102C085E490E10E941721AB
:1012000029C28AE290E102C08EE090E10E949B2018
:1012100021C28DE59FE0EACF84E59FE0E7CF8BE434
:101220009FE0E4CF80E39FE0E1CF81E29FE0EECF5B
:101230008FEA92E1E3CF8DEF9FE0E0CF89EE9FE070
:10124000E5CF83EF9EE005C081EC9EE002C083E81D
:101250009EE00E94BD21FEC181111EC06091060763
:1012600020E1620F08F46FEF8091FE069091FF0677
:101270000E94D8126AE070E00E940130892B09F0C8
:10128000E8C10E943C2F64E570E00E941530609137
:1012900043010E947213DDC18091420191E1899F57
:1012A000802D112401E1080F053508F004E5E82E32
:1012B000F12CC02ED12CEC14FD040CF0C7C16091B0
:1012C0004301C7010E9472136FEFE61AF60AF3CFCB
:1012D00081111EC06091060720E1620F08F46FEFD4
:1012E0008091FE069091FF060E94D81265E070E0A2
:1012F0000E940130892B09F0ACC10E943C2F64E5AB
:1013000070E00E941530609143010E94B813A1C1A2
:101310008091420191E1899F802D112401E1080F04
:10132000053508F004E5E82EF12CC02ED12CEC1484
:10133000FD040CF08BC160914301C7010E94B813FA
:101340007FEFE71AF70AF3CF8CE79EE002C086E74B
:101350009EE00E941E227EC18091D50621E0382F9A
:10136000321B08F430E0832F6DE57EE03BC06DE575
:101370007EE037C08091D50621E0582F521B08F43B
:1013800050E0852F65E27EE02DC065E27EE029C059
:101390008091D50621E0682F621B08F460E0862F5B
:1013A00063EF7DE01FC063EF7DE01BC08091D50639
:1013B00021E0782F721B08F470E0872F6BED7DE041
:1013C00011C06BED7DE00DC08091D50621E0382F76
:1013D000321B08F430E0832F65EC7DE003C065EC40
:1013E0007DE080E00E948A2235C18091DE03811178
:1013F00025C069EC71E040E050E0942F9295907F19
:1014000020E030E0FB01E20FF31F8081843538F4E7
:10141000E82FF0E0E657FC4F892F822B80832F5F67
:101420003F4F2E30310571F74F5F5F4F625F7F4F47
:101430004630510511F781E08093DE0300914201AF
:1014400081E1089F002D1124B1E1DB2ED00E54E57F
:101450005D1510F4A4E5DA2E609100057091010588
:1014600080910205909103050E94F527C82E609196
:10147000030770910407809105070E94E212B62EBF
:10148000A72E782E0D1518F5E02EF12CF701EB5351
:10149000FD4F9081809143018923B9F0F701E65710
:1014A000FC4F6081462F4F7062956F708C2D0E94AB
:1014B0000F12029720F420E040E060E003C0272DE7
:1014C0004B2D6A2DC7010E9445120F5FDBCF81E0D3
:1014D00063E56D1508F0BEC0BCC00091420181E11A
:1014E000089F002D1124F1E17F2E700E74E5771511
:1014F00010F4E4E57E2EEE24EA94F12C0715A0F515
:10150000E02FF0E0DF01AB53BD4F9C918091430190
:10151000892341F1DF01AA0FBB1FAE0FBF1FAC5FD4
:10152000BB4FAC901196CC90119712968C919091E4
:101530000507A99E50011124C99E60011124899FAD
:10154000C0011124B7010E940130262FC501B70147
:101550000E940130462FC601B7010E940130CF0121
:101560000E9445120F5FCACF81E093E5971508F0FE
:1015700071C06FC0D090420191E1D99ED02C11244E
:1015800001E10D0D053508F004E5811106C08091DB
:10159000E3038F5F8093E30304C01092E303109290
:1015A000E2038091E303811147C08091E203883018
:1015B00029F41092E1031092E2033EC0A82FB0E09C
:1015C000AA0FBB1FA357BE4FEC9111969C91AEE0A2
:1015D000EA9FF0011124E753FE4FE90FF11D9081BE
:1015E0009F3F21F09093DF0391E001C090E0909342
:1015F000E1038F5F8093E2031FC0ED2CF12CF70114
:10160000EB53FD4F9081809143018923A1F06091BC
:10161000E3036D0D2091E103EFEDF3E080E77FEF51
:1016200090E092130CC00E94E212462F282F672FE1
:10163000C7010E944512D394D016F8F207C0319129
:10164000D31202C08FEF70E09F5FEBCF81E00435D3
:1016500008F080E0909142019F5F909342018111D8
:1016600034C082E080931A018091440181112DC021
:10167000112351F02AC01093190180910207837041
:10168000809318010E94821083E080931A011DC08C
:101690004091FE065091FF0660910007709101078E
:1016A0002FB7F8948091E4039091E503A091E603AD
:1016B000B091E7032FBF841B950BA60BB70B409788
:1016C000A105B10510F010921A010E946D119091C0
:1016D000E903891721F00E946D118093E90380913D
:1016E000CB06843009F046CA83E08093E9008091FC
:1016F000E80082FF3FCA8091E80085FF21C00E9478
:10170000A92B81111BC000E210E0FE0131967F0180
:1017100008C08091F100D7018D937D01015011091E
:1017200069F08091E80085FDF4CF8091E8008B7727
:101730008093E8000E94A92B882399F391E001C0CF
:1017400090E08091E8008B778093E800992309F47A
:1017500011CA81E08A83E9818E2F90E0FC013197E4
:10176000E331F10508F0AAC1E258FF4F0C9429308B
:1017700086E78B838CEE8C8381E012C14EE150E0D2
:1017800062E571E004C04EE150E064E671E0CE0134
:1017900003960E94383091C180910505882309F491
:1017A0008DC11A8281E08093040588C18B818430C9
:1017B00008F084C16C81663008F080C14D814E30E4
:1017C00008F07CC10E940F128E839F8376C19B819B
:1017D000943008F073C10C81063008F06FC18D8120
:1017E0008E3008F06BC1FE806F81BCE10B9F8001E1
:1017F0001124E8EA9E9F000D111D1124080F111DF0
:10180000080F111D0D5B1F4FC8010E947A2F6F2D0D
:10181000C80101960E947A2F50C18091050581115F
:101820004DC18B81803F49F0813F49F0823F49F0B3
:10183000833F09F043C1E3E005C0E0E003C0E1E01D
:1018400001C0E2E025E0E29FF0011124E55EFE4FD9
:1018500083818C8380EBA4C08091050581112EC10A
:101860008B819C81903B08F090EB803F49F0813F59
:1018700049F0823F49F0833F09F020C1E3E005C011
:10188000E0E003C0E1E001C0E2E035E0E39FF00109
:101890001124E55EFE4F9383A8C080910505811158
:1018A0000DC1EB81E43558F0E03FC1F0E13FC1F0FC
:1018B000E23FC1F0E33F09F001C1E3E014C0F0E012
:1018C000CF01880F991FE80FF91FEC5FFB4F818153
:1018D0008C8380818D8382818E83EFC0E0E003C0A2
:1018E000E1E001C0E2E055E0E59FF0011124E55E92
:1018F000FE4F81818C8382818D831E82DEC0809128
:1019000005058111DBC0EB818D819C81E43558F0A8
:10191000E03FB1F0E13FB1F0E23FB1F0E33F09F069
:10192000CDC0E3E012C02E81F0E0AF01440F551F9F
:10193000E40FF51FEC5FFB4F808391832283BDC0D2
:10194000E0E003C0E1E001C0E2E065E0E69FF00115
:101950001124E55EFE4F9183828347C08091050587
:101960008111ACC0EB81E43008F0A8C02E2F30E02C
:1019700075E0E79FF0011124E55EFE4F908196959A
:101980009695EDE9F1E0419194130CC08C8385E0CC
:10199000829FF001839FF00D1124E55EFE4F84814C
:1019A0008D838BC08F5F8F3071F788C08091050564
:1019B000811184C0EB81E43008F080C0AC81AF308D
:1019C00008F07CC02D8185E0E89FF0011124E55EE0
:1019D000FE4FB0E0A356BE4F8C91982F990F990FF0
:1019E00080818370892B808324831A826091000513
:1019F0007091010580910205909103050E94FC2AD7
:101A00005DC080910505811159C081E00E94282B9D
:101A100054C086E08B838EE08C8387EFE82E83E0D2
:101A2000F82E16E0A0E0B4E040E050E0B03258F507
:101A3000F70160817181C101042E02C0880F991FD6
:101A40000A94E2F7682379238B2F90E091010A2E04
:101A500001C0220F0A94EAF7672B51F061E070E0B1
:101A60006C0F7D1F860F971FFC013081232B0AC04E
:101A700061E070E06C0F7D1F860F971F2095FC01C1
:101A8000308123232083AF5FA83010F0BF5FA0E038
:101A90004F5F5F4F4E30510549F61150F2E0EF0EA7
:101AA000F11C1111C1CF09C00E94AD1F81E09B81C3
:101AB000911101C080E0809303041A828091CB06CB
:101AC000843009F51091E9001F709091EC00892F86
:101AD000817090FD80E8182B82E08093E90080916E
:101AE000E80080FF0DC040E050E060E270E0CE0111
:101AF00001960E94C21F8091E8008E778093E800D3
:101B00001F701093E90080910405882311F40C9450
:101B1000BA052FEF30E752E0215030405040E1F756
:101B200000C000000E948B1A0C94BA0509BD19BDB3
:101B300009B400FEFDCF8091D8008F7D8093D8003E
:101B40008091E00082608093E0008091E00081FD60
:101B5000FCCF0E94AD1F0C94C505EBE0F5E096E0CC
:101B6000E730F90729F08183608342833396F7CF0A
:101B70000895FC01EE0FFF1F8E0F9F1FFC01E55F14
:101B8000FA4F6183408322830895EF92FF920F936F
:101B90009701201B31092F3F310519F010F02FEF6D
:101BA00030E02095382F320F08F43FEF832F0F914C
:101BB000FF90EF900895EF92FF920F939701201BF3
:101BC00031092F3F310519F010F02FEF30E0322F9F
:101BD0003095482F430F08F44FEF842F620F0F9179
:101BE000FF90EF900895EF92FF920F93972F093493
:101BF00038F4B701601B71096F3F710519F010F0DF
:101C00006FEF70E0485F5F4F4131510540F0A9012F
:101C1000485F5F4F4131510510F06FEF70E0609504
:101C2000482F460F08F44FEF842F37FF02C02D5F77
:101C30003F4F359527953595279560910307620F9E
:101C4000792F0F91FF90EF900895EF92FF920F93ED
:101C5000E00EF11CF90137FF03C0F195E195F109A0
:101C600024E0EE0FFF1F2A95E1F7EF3FF10519F091
:101C700014F0EFEFF0E09A0157FF03C03195219582
:101C8000310994E0220F331F9A95E1F72E173F0791
:101C90000CF4F901EE0DFF1DEF3FF10519F010F006
:101CA000EFEFF0E02E2F2095382F320F08F43FEFA2
:101CB000832F0F91FF90EF900895EF92FF920F9373
:101CC000970195E0099F200D311D11242F3F31050B
:101CD00019F010F02FEF30E02095382F320F08F474
:101CE0003FEF832F0F91FF90EF90089522E8241B80
:101CF00008F420E0620F08954095282F429F412D5F
:101D00001124842F08950F931F9310E0F801EE0F14
:101D1000FF1FE35EFD4F9081905797FD9195000F57
:101D2000111FF801E25EFD4FE081F0E0B097DF01A6
:101D3000AA0FBB1F8D010E0F1F1F2003D001219F73
:101D4000B00D1124E8E3F0E0E91BF10997FDF395EC
:101D50009F01220F331F89010E0F1F1F40039001A7
:101D6000419F300D11242A0F3B1F37FF02C021581D
:101D70003F4F220F232F221F330B620F1F910F9112
:101D800008950F931F93522F10E0F801EE0FFF1FDD
:101D9000E25EFD4FE081F0E0B097EE0FFF1F9F0184
:101DA0005203D001539FB00D1124000F111FF801F1
:101DB000E35EFD4F008110E000571109000F111F75
:101DC00040039001419F300D11242A0F3B1F37FF24
:101DD00002C021583F4F220F232F221F330B620FC7
:101DE0001F910F9108950F931F93522F10E0F80148
:101DF000EE0FFF1FE25EFD4FE081F0E0B0979F0124
:101E00005203D001539FB00D1124000F111FF80190
:101E1000E35EFD4F008110E000571109400390017F
:101E2000419F300D11242A0F3B1F37FF02C021585C
:101E30003F4F220F232F221F330B620F1F910F9151
:101E40000895EF920F931F9393E0099F800111244F
:101E5000159507956E2D600F1F910F91EF900895C6
:101E6000A22F50E0FA01EE0FFF1FE25EFD4F9081BE
:101E7000905297FD9195440F551FFA01E35EFD4F77
:101E80003081232F30E02A1B3109290F311D97FDA6
:101E90003A95620F0895E42FF0E0EE0FFF1FE25E27
:101EA000FD4F6081621B0895E42FF0E0EE0FFF1FED
:101EB000E35EFD4F6081621B0895622F0895E42F59
:101EC000F0E0EE0FFF1FE35EFD4F408134EE439FD5
:101ED000412D1124E82FF0E050E0445E5F4FDA011D
:101EE000A21BB1099D01B7FF03C0319521953109AE
:101EF00093E0220F331F9A95E1F7AF01421B530B7A
:101F00009A0157FF02C020E030E0582F259F212D75
:101F10001124822F0895E42FF0E0EE0FFF1FE35EFF
:101F2000FD4F408134EE439F412D1124E72FF0E017
:101F300050E0445E5F4FDA01A21BB1099D01B7FF7B
:101F400003C031952195310993E0220F331F9A95F3
:101F5000E1F7AF01421B530B9A0157FF02C020E08B
:101F600030E0279F212D1124722F0895FC019B0141
:101F7000009721F477FF2BC080E80895AC0197FF0C
:101F800004C044275527481B590BB901640F751F1E
:101F900037FD0CC0241B350BC901A5E0880F991F24
:101FA000AA95E1F70E94153080E20CC0CB0165E0F4
:101FB000880F991F6A95E1F7BA01621B730B0E94A3
:101FC000153080E6861BF7FF03C08195089580E0F9
:101FD0000895EF920F93CF93DF93D72FC82FC901A6
:101FE0000E19BA010E94B60F602F681B7D2F8C2F2F
:101FF000DF91CF910F91EF9008950F93CF93DF93DF
:10200000D72FC82FC901BA010E94B60F682F600FE1
:102010007D2F8C2FDF91CF910F910895EF920F9329
:102020001F93CF93DF93D62FC72F182FC9010E19F7
:10203000010FBA010E94B60F081B202F219F212DEE
:102040001124822F6D2F7C2FDF91CF911F910F9143
:10205000EF900895EF920F931F93CF93DF93D62FB6
:10206000172FC82FC9010E19070FBA010E94B60F0A
:10207000702F781B719F712D11246D2F8C2FDF9184
:10208000CF911F910F91EF900895FF920F931F939F
:10209000CF93DF93F62ED72F182FC901C12FC01B66
:1020A000BA010E94B60F982F990F890FC81B2C2FC9
:1020B000219F212D1124822F6F2D7D2FDF91CF9114
:1020C0001F910F91FF900895FF920F931F93CF934D
:1020D000DF93F62E172FD82FC901C72FC01BBA01C7
:1020E0000E94B60F982F990F890F7C2F781B719F34
:1020F000712D11246F2D8D2FDF91CF911F910F9195
:10210000FF9008956A9A8EB18B7F9EB194602FB72D
:10211000F894EBE0F5E036E0E730F30761F0319159
:1021200048E09EB937FF8EB9330F000000C08EB96A
:102130004A95B9F7F0CF2FBF8FE292E00197F1F700
:1021400000C00000
gitextract_79fuba_k/
├── .cargo/
│ └── config
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── version.py
├── .gitignore
├── Cargo.toml
├── LICENSE
├── Makefile
├── README.md
├── RELEASING.md
├── backend/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── examples/
│ │ ├── benchmark.rs
│ │ └── daemon.rs
│ ├── i18n.toml
│ └── src/
│ ├── backend.rs
│ ├── benchmark/
│ │ ├── block_dev.rs
│ │ ├── mod.rs
│ │ ├── usb_dev.rs
│ │ └── usb_hub.rs
│ ├── board.rs
│ ├── color.rs
│ ├── daemon/
│ │ ├── client.rs
│ │ ├── daemon_thread.rs
│ │ ├── dummy.rs
│ │ ├── mod.rs
│ │ ├── s76power.rs
│ │ └── server.rs
│ ├── deref_cell.rs
│ ├── key.rs
│ ├── keymap.rs
│ ├── layer.rs
│ ├── layout/
│ │ ├── meta.rs
│ │ ├── mod.rs
│ │ └── physical_layout.rs
│ ├── lib.rs
│ ├── localize.rs
│ ├── matrix.rs
│ ├── mode.rs
│ ├── nelson.rs
│ └── rect.rs
├── build.rs
├── data/
│ ├── com.system76.keyboardconfigurator.gresource.xml
│ ├── system76_launch_1_default.hex
│ ├── system76_launch_2_default.hex
│ ├── system76_launch_heavy_1_default.hex
│ └── system76_launch_lite_1_default.hex
├── debian/
│ ├── changelog
│ ├── com.system76.pkexec.keyboardconfigurator.policy
│ ├── compat
│ ├── control
│ ├── copyright
│ ├── libsystem76-keyboard-configurator-dev.install
│ ├── libsystem76-keyboard-configurator.install
│ ├── libsystem76-keyboard-configurator.trigger
│ ├── rules
│ ├── source/
│ │ ├── format
│ │ └── options
│ ├── system76-keyboard-configurator.install
│ └── test-launch-system76-keyboard-configurator.install
├── ffi/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── src/
│ │ └── lib.rs
│ ├── system76_keyboard_configurator.h
│ └── system76_keyboard_configurator.pc.in
├── flake.nix
├── i18n/
│ ├── cs/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── da/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── de/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── en/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── es/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── fi/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── fr/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── hu/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── it/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── ko/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── nl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── pl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── pt-BR/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── ru/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ ├── sl/
│ │ ├── system76_keyboard_configurator.ftl
│ │ ├── system76_keyboard_configurator_backend.ftl
│ │ └── system76_keyboard_configurator_widgets.ftl
│ └── tr/
│ ├── system76_keyboard_configurator.ftl
│ ├── system76_keyboard_configurator_backend.ftl
│ └── system76_keyboard_configurator_widgets.ftl
├── i18n.toml
├── layouts/
│ ├── README.md
│ ├── keyboards/
│ │ └── system76/
│ │ ├── 14in_81/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 14in_83/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 14in_86/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 15in_102/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 15in_102_nkey/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 18H9LHA04/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── 18H9LHA05/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_2/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_3/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_alpha_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_alpha_2/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_heavy_1/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ ├── launch_heavy_3/
│ │ │ ├── layout.json
│ │ │ ├── leds.json
│ │ │ └── physical.json
│ │ └── launch_lite_1/
│ │ ├── layout.json
│ │ ├── leds.json
│ │ └── physical.json
│ ├── keymap/
│ │ ├── ec.json
│ │ ├── qmk.json
│ │ └── qmk_legacy.json
│ ├── picker.json
│ └── system76/
│ ├── addw1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── addw4/
│ │ ├── default.json
│ │ └── meta.json
│ ├── bonw14/
│ │ ├── default.json
│ │ └── meta.json
│ ├── bonw15/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp10-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp11-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp8/
│ │ ├── default.json
│ │ └── meta.json
│ ├── darp9/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp3-c/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp4/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── galp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze15/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3050/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3060/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze16-3060-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze17-3050/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze17-3060-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze18/
│ │ ├── default.json
│ │ └── meta.json
│ ├── gaze20/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_alpha_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_alpha_2/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_heavy_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_heavy_3/
│ │ ├── default.json
│ │ └── meta.json
│ ├── launch_lite_1/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp12/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp13/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp13-b/
│ │ ├── default.json
│ │ └── meta.json
│ ├── lemp9/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp10/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp11/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp12/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp5/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp6/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp7/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp8/
│ │ ├── default.json
│ │ └── meta.json
│ ├── oryp9/
│ │ ├── default.json
│ │ └── meta.json
│ └── serw13/
│ ├── default.json
│ └── meta.json
├── layouts.py
├── linux/
│ ├── build.py
│ ├── com.system76.keyboardconfigurator.appdata.xml
│ ├── com.system76.keyboardconfigurator.desktop
│ ├── com.system76.keyboardconfiguratorlaunchtest.desktop
│ └── linuxdeploy-plugin-gtk.sh
├── macos/
│ ├── Info.plist.in
│ ├── README.md
│ ├── appdmg.json
│ ├── build.py
│ ├── deploy.py
│ ├── launcher.sh
│ └── signing.sh
├── rust-toolchain.toml
├── src/
│ ├── about_dialog.rs
│ ├── backlight.rs
│ ├── configurator_app.rs
│ ├── error_dialog.rs
│ ├── keyboard.rs
│ ├── keyboard_layer.rs
│ ├── localize.rs
│ ├── main.rs
│ ├── main_window.rs
│ ├── page.rs
│ ├── picker/
│ │ ├── mod.rs
│ │ ├── picker_group.rs
│ │ ├── picker_group_box.rs
│ │ ├── picker_json.rs
│ │ └── picker_key.rs
│ ├── shortcuts_window.rs
│ ├── shortcuts_window.ui
│ └── testing.rs
├── tools/
│ ├── Cargo.toml
│ └── src/
│ └── pkgconfig.rs
├── widgets/
│ ├── Cargo.toml
│ ├── examples/
│ │ └── keyboard_color.rs
│ ├── i18n.toml
│ └── src/
│ ├── choose_color.rs
│ ├── color_circle.rs
│ ├── color_wheel.rs
│ ├── keyboard_backlight_widget.rs
│ ├── keyboard_color.rs
│ ├── lib.rs
│ ├── localize.rs
│ └── selected_keys.rs
└── windows/
├── README.md
├── build.bat
├── build.py
├── gpl.rtf
└── keyboard-configurator.wxs
SYMBOL INDEX (642 symbols across 60 files)
FILE: backend/build.rs
function main (line 8) | fn main() {
FILE: backend/examples/benchmark.rs
function benchmark (line 5) | fn benchmark() -> io::Result<()> {
function main (line 14) | fn main() {
FILE: backend/examples/daemon.rs
function with_daemon (line 5) | fn with_daemon<F: Fn(Backend, Events)>(f: F) {
function with_daemon (line 17) | fn with_daemon<F: Fn(Backend, Events)>(f: F) {
function main (line 22) | fn main() {
FILE: backend/src/backend.rs
type Event (line 17) | pub enum Event {
type Events (line 29) | pub struct Events(async_mpsc::UnboundedReceiver<Event>);
type Item (line 32) | type Item = Event;
method poll_next (line 34) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Even...
method is_terminated (line 42) | fn is_terminated(&self) -> bool {
type BackendInner (line 50) | struct BackendInner {
type Backend (line 56) | pub struct Backend(Arc<BackendInner>);
method new_internal (line 61) | fn new_internal<T: Daemon + 'static>(daemon: T) -> Result<(Self, Event...
method new_dummy (line 80) | pub fn new_dummy(board_names: Vec<String>) -> Result<(Self, Events), S...
method new_s76power (line 86) | pub fn new_s76power() -> Result<(Self, Events), String> {
method new_pkexec (line 90) | pub fn new_pkexec() -> Result<(Self, Events), String> {
method new (line 94) | pub fn new() -> Result<(Self, Events), String> {
method refresh (line 101) | pub fn refresh(&self) {
method check_for_bootloader (line 110) | pub fn check_for_bootloader(&self) {
method set_matrix_get_rate (line 119) | pub fn set_matrix_get_rate(&self, rate: Option<Duration>) {
method drop (line 128) | fn drop(&mut self) {
function run_daemon (line 133) | pub fn run_daemon() -> ! {
FILE: backend/src/benchmark/block_dev.rs
constant ALIGN (line 11) | const ALIGN: usize = 4096;
constant SIZE (line 12) | const SIZE: usize = ALIGN * 1024;
type BlockDev (line 15) | pub struct BlockDev(PathBuf);
method new (line 18) | pub fn new(path: PathBuf) -> Self {
method path (line 22) | pub fn path(&self) -> &Path {
method benchmark (line 26) | pub fn benchmark(&self) -> io::Result<f64> {
FILE: backend/src/benchmark/mod.rs
type Benchmark (line 11) | pub struct Benchmark {
method new (line 16) | pub fn new() -> io::Result<Self> {
FILE: backend/src/benchmark/usb_dev.rs
type UsbDev (line 8) | pub struct UsbDev(PathBuf);
method new (line 11) | pub fn new(path: PathBuf) -> Self {
method path (line 15) | pub fn path(&self) -> &Path {
method vendor_id (line 19) | pub fn vendor_id(&self) -> io::Result<u16> {
method product_id (line 26) | pub fn product_id(&self) -> io::Result<u16> {
method block_devs (line 33) | pub fn block_devs(&self) -> io::Result<Vec<BlockDev>> {
FILE: backend/src/benchmark/usb_hub.rs
constant SYSTEM76_VID (line 5) | const SYSTEM76_VID: u16 = 0x3384;
constant USB_2_HUB_PID (line 6) | const USB_2_HUB_PID: u16 = 0x0003;
constant USB_3_HUB_PID (line 7) | const USB_3_HUB_PID: u16 = 0x0004;
constant USB_2_HUB_PID_ALT (line 9) | const USB_2_HUB_PID_ALT: u16 = 0x4216;
constant USB_3_HUB_PID_ALT (line 10) | const USB_3_HUB_PID_ALT: u16 = 0x7216;
type UsbHub (line 12) | pub enum UsbHub {
method probe (line 18) | pub fn probe() -> io::Result<Vec<Self>> {
method usb_dev (line 41) | pub fn usb_dev(&self) -> &UsbDev {
method path (line 48) | pub fn path(&self) -> &Path {
method ports (line 52) | pub fn ports(&self) -> io::Result<BTreeMap<String, UsbDev>> {
FILE: backend/src/board.rs
type BoardEvent (line 21) | pub enum BoardEvent {
type BoardInner (line 28) | struct BoardInner {
type Board (line 49) | pub struct Board(Arc<BoardInner>);
method new (line 73) | pub fn new(
method send_event (line 146) | pub(crate) fn send_event(&self, event: BoardEvent) {
method set_leds_changed (line 153) | pub(crate) fn set_leds_changed(&self) {
method board (line 158) | pub fn board(&self) -> BoardId {
method thread_client (line 162) | pub(crate) fn thread_client(&self) -> &ThreadClient {
method model (line 166) | pub fn model(&self) -> &str {
method version (line 170) | pub fn version(&self) -> &str {
method has_matrix (line 174) | pub fn has_matrix(&self) -> bool {
method max_brightness (line 178) | pub fn max_brightness(&self) -> i32 {
method benchmark (line 182) | pub async fn benchmark(&self) -> Result<Benchmark, String> {
method nelson (line 186) | pub async fn nelson(&self, kind: NelsonKind) -> Result<Nelson, String> {
method led_save (line 190) | pub async fn led_save(&self) -> Result<(), String> {
method block_led_save (line 202) | pub fn block_led_save(&self) {
method unblock_led_save (line 206) | pub fn unblock_led_save(&self) {
method is_fake (line 210) | pub fn is_fake(&self) -> bool {
method is_lite (line 214) | pub fn is_lite(&self) -> bool {
method is_updated (line 219) | pub fn is_updated(&self) -> bool {
method has_led_save (line 223) | pub fn has_led_save(&self) -> bool {
method has_keymap (line 227) | pub fn has_keymap(&self) -> bool {
method layout (line 231) | pub fn layout(&self) -> &Layout {
method layers (line 235) | pub fn layers(&self) -> &[Layer] {
method keys (line 239) | pub fn keys(&self) -> &[Key] {
method matrix (line 243) | pub(crate) fn matrix(&self) -> MutexGuard<Matrix> {
method export_keymap (line 247) | pub fn export_keymap(&self) -> KeyMap {
method set_no_input (line 277) | pub async fn set_no_input(&self, no_input: bool) -> Result<(), String> {
method downgrade (line 283) | pub(crate) fn downgrade(&self) -> WeakBoard {
method eq (line 52) | fn eq(&self, other: &Self) -> bool {
type Bootloaded (line 60) | pub enum Bootloaded {
type WeakBoard (line 70) | pub(crate) struct WeakBoard(Weak<BoardInner>);
method upgrade (line 289) | pub fn upgrade(&self) -> Option<Board> {
function is_launch_updated (line 294) | pub fn is_launch_updated() -> Result<bool, String> {
FILE: backend/src/color.rs
type PaletteHsv (line 6) | type PaletteHsv = palette::Hsv<palette::encoding::Srgb, f64>;
type PaletteLinSrgb (line 7) | type PaletteLinSrgb = palette::LinSrgb<f64>;
type Hs (line 15) | pub struct Hs {
method new (line 23) | pub fn new(h: f64, s: f64) -> Self {
method from_ints (line 30) | pub fn from_ints(h: u8, s: u8) -> Self {
method to_ints (line 34) | pub fn to_ints(self) -> (u8, u8) {
method to_rgb (line 39) | pub fn to_rgb(self) -> Rgb {
type Rgb (line 52) | pub struct Rgb {
method new (line 62) | pub fn new(r: u8, g: u8, b: u8) -> Self {
method from_floats (line 66) | pub fn from_floats(r: f64, g: f64, b: f64) -> Self {
method to_floats (line 74) | pub fn to_floats(self) -> (f64, f64, f64) {
method parse (line 79) | pub fn parse(s: &str) -> Option<Self> {
method to_hs_lossy (line 91) | pub fn to_hs_lossy(self) -> Hs {
method fmt (line 102) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
method deserialize (line 128) | fn deserialize<D: de::Deserializer<'de>>(deserializer: D) -> Result<Se...
method serialize (line 108) | fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok...
type RgbVisitor (line 113) | struct RgbVisitor;
type Value (line 116) | type Value = Rgb;
method expecting (line 118) | fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
method visit_str (line 122) | fn visit_str<E: de::Error>(self, v: &str) -> Result<Rgb, E> {
function test_hs_rgb_hs (line 138) | fn test_hs_rgb_hs() {
FILE: backend/src/daemon/client.rs
type DaemonClient (line 11) | pub struct DaemonClient {
method new_pkexec (line 18) | pub fn new_pkexec() -> Self {
method send_command (line 55) | fn send_command(&self, command: DaemonCommand) -> Result<DaemonResponse,...
method drop (line 73) | fn drop(&mut self) {
FILE: backend/src/daemon/daemon_thread.rs
type Item (line 25) | struct Item<K: Hash + Eq, V> {
function new (line 31) | fn new(key: K, value: V) -> Self {
method hash (line 37) | fn hash<H: Hasher>(&self, state: &mut H) {
method eq (line 43) | fn eq(&self, other: &Self) -> bool {
type SetEnum (line 51) | enum SetEnum {
method is_cancelable (line 67) | fn is_cancelable(&self) -> bool {
type Set (line 73) | struct Set {
method reply (line 105) | fn reply<T: Into<Response>>(self, resp: Result<T, String>) {
type Response (line 79) | enum Response {
method from (line 87) | fn from(benchmark: Benchmark) -> Self {
method from (line 93) | fn from(_unit: ()) -> Self {
method from (line 99) | fn from(nelson: Nelson) -> Self {
type ThreadClient (line 111) | pub struct ThreadClient {
method new (line 118) | pub fn new(
method send (line 135) | async fn send(&self, set_enum: SetEnum) -> Result<Response, String> {
method send_noresp (line 160) | async fn send_noresp(&self, set_enum: SetEnum) -> Result<(), String> {
method refresh (line 164) | pub async fn refresh(&self) -> Result<(), String> {
method check_for_bootloader (line 168) | pub async fn check_for_bootloader(&self) -> Result<(), String> {
method keymap_set (line 199) | pub async fn keymap_set(
method set_color (line 214) | pub async fn set_color(
method set_brightness (line 224) | pub async fn set_brightness(
method set_mode (line 234) | pub async fn set_mode(
method set_matrix_get_rate (line 245) | pub async fn set_matrix_get_rate(&self, rate: Option<Duration>) -> Res...
method benchmark (line 250) | pub async fn benchmark(&self, board: BoardId) -> Result<Benchmark, Str...
method nelson (line 259) | pub async fn nelson(&self, board: BoardId, kind: NelsonKind) -> Result...
method led_save (line 268) | pub async fn led_save(&self, board: BoardId) -> Result<(), String> {
method set_no_input (line 272) | pub async fn set_no_input(&self, board: BoardId, no_input: bool) -> Re...
method close (line 276) | pub fn close(&self) {
type ThreadBoard (line 301) | struct ThreadBoard {
method new (line 309) | fn new(
type Thread (line 324) | struct Thread {
method new (line 335) | fn new(
method spawn (line 351) | fn spawn(self, mut channel: async_mpsc::UnboundedReceiver<Set>) -> Joi...
method handle_set (line 382) | fn handle_set(&self, set: Set) -> bool {
method matrix_refresh_all (line 418) | fn matrix_refresh_all(&self) {
method bootloader_update (line 440) | fn bootloader_update(&self, update: Option<Bootloaded>) -> Result<(), ...
method refresh (line 463) | fn refresh(&self) -> Result<(), String> {
FILE: backend/src/daemon/dummy.rs
type BoardDummy (line 6) | struct BoardDummy {
method valid_index (line 16) | fn valid_index(&self, index: u8, allow_key: bool) -> bool {
type DaemonDummy (line 27) | pub struct DaemonDummy {
method new (line 32) | pub fn new(board_names: Vec<String>) -> Result<Self, String> {
method board (line 53) | fn board(&self, board: BoardId) -> Result<&BoardDummy, String> {
method boards (line 61) | fn boards(&self) -> Result<Vec<BoardId>, String> {
method model (line 65) | fn model(&self, board: BoardId) -> Result<String, String> {
method version (line 69) | fn version(&self, _board: BoardId) -> Result<String, String> {
method is_fake (line 73) | fn is_fake(&self) -> bool {
method keymap_get (line 77) | fn keymap_get(&self, board: BoardId, layer: u8, output: u8, input: u8) -...
method keymap_set (line 82) | fn keymap_set(
method matrix_get (line 95) | fn matrix_get(&self, _board: BoardId) -> Result<Matrix, String> {
method benchmark (line 99) | fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
method nelson (line 103) | fn nelson(&self, _board: BoardId, _kind: NelsonKind) -> Result<Nelson, S...
method color (line 107) | fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), Strin...
method set_color (line 115) | fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> R...
method max_brightness (line 124) | fn max_brightness(&self, _board: BoardId) -> Result<i32, String> {
method brightness (line 128) | fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
method set_brightness (line 136) | fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> ...
method mode (line 145) | fn mode(&self, board: BoardId, layer: u8) -> Result<(u8, u8), String> {
method set_mode (line 154) | fn set_mode(&self, board: BoardId, layer: u8, mode: u8, speed: u8) -> Re...
method led_save (line 164) | fn led_save(&self, board: BoardId) -> Result<(), String> {
method refresh (line 169) | fn refresh(&self) -> Result<(), String> {
method set_no_input (line 173) | fn set_no_input(&self, _board: BoardId, _no_input: bool) -> Result<(), S...
method exit (line 177) | fn exit(&self) -> Result<(), String> {
FILE: backend/src/daemon/mod.rs
type BoardId (line 18) | pub struct BoardId(u128);
type DaemonClientTrait (line 20) | pub trait DaemonClientTrait: Send + 'static {
method send_command (line 21) | fn send_command(&self, command: DaemonCommand) -> Result<DaemonRespons...
function err_str (line 102) | fn err_str<E: std::fmt::Debug>(err: E) -> String {
FILE: backend/src/daemon/s76power.rs
constant DBUS_NAME (line 11) | const DBUS_NAME: &str = "com.system76.PowerDaemon";
type Keyboard (line 17) | trait Keyboard {
method brightness (line 19) | fn brightness(&self) -> zbus::Result<i32>;
method set_brightness (line 21) | fn set_brightness(&self, value: i32) -> zbus::Result<()>;
method color (line 24) | fn color(&self) -> zbus::Result<String>;
method set_color (line 26) | fn set_color(&self, value: &str) -> zbus::Result<()>;
method max_brightness (line 29) | fn max_brightness(&self) -> zbus::Result<i32>;
method name (line 32) | fn name(&self) -> zbus::Result<String>;
method new (line 40) | fn new(path: &str) -> Result<Self, String> {
type Keyboard (line 35) | struct Keyboard {
method brightness (line 19) | fn brightness(&self) -> zbus::Result<i32>;
method set_brightness (line 21) | fn set_brightness(&self, value: i32) -> zbus::Result<()>;
method color (line 24) | fn color(&self) -> zbus::Result<String>;
method set_color (line 26) | fn set_color(&self, value: &str) -> zbus::Result<()>;
method max_brightness (line 29) | fn max_brightness(&self) -> zbus::Result<i32>;
method name (line 32) | fn name(&self) -> zbus::Result<String>;
method new (line 40) | fn new(path: &str) -> Result<Self, String> {
type DaemonS76Power (line 53) | pub struct DaemonS76Power {
method board (line 58) | fn board(&self, board: BoardId) -> Result<&Keyboard, String> {
method new (line 66) | pub fn new() -> Result<Self, String> {
method boards (line 90) | fn boards(&self) -> Result<Vec<BoardId>, String> {
method model (line 94) | fn model(&self, _board: BoardId) -> Result<String, String> {
method version (line 99) | fn version(&self, _board: BoardId) -> Result<String, String> {
method keymap_get (line 103) | fn keymap_get(
method keymap_set (line 113) | fn keymap_set(
method matrix_get (line 124) | fn matrix_get(&self, _board: BoardId) -> Result<Matrix, String> {
method benchmark (line 128) | fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
method nelson (line 132) | fn nelson(&self, _board: BoardId, _kind: NelsonKind) -> Result<Nelson, S...
method color (line 136) | fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), Strin...
method set_color (line 144) | fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> R...
method max_brightness (line 154) | fn max_brightness(&self, board: BoardId) -> Result<i32, String> {
method brightness (line 158) | fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
method set_brightness (line 165) | fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> ...
method mode (line 175) | fn mode(&self, _board: BoardId, _layer: u8) -> Result<(u8, u8), String> {
method set_mode (line 179) | fn set_mode(&self, _board: BoardId, _layer: u8, _mode: u8, _speed: u8) -...
method led_save (line 183) | fn led_save(&self, _board: BoardId) -> Result<(), String> {
method refresh (line 187) | fn refresh(&self) -> Result<(), String> {
method set_no_input (line 191) | fn set_no_input(&self, _board: BoardId, _no_input: bool) -> Result<(), S...
method exit (line 195) | fn exit(&self) -> Result<(), String> {
FILE: backend/src/daemon/server.rs
constant QMK_RAW_USAGE_PAGE (line 18) | const QMK_RAW_USAGE_PAGE: u16 = 0xFF60;
constant QMK_RAW_USAGE_ID (line 19) | const QMK_RAW_USAGE_ID: u16 = 0x61;
type DaemonServer (line 22) | pub struct DaemonServer<R: Read + Send + 'static, W: Write + Send + 'sta...
function new_stdio (line 33) | pub fn new_stdio() -> Result<Self, String> {
function new (line 39) | pub fn new(read: R, write: W) -> Result<Self, String> {
function have_device (line 83) | fn have_device(&self, info: &DeviceInfo) -> bool {
function run (line 96) | pub fn run(mut self) -> io::Result<()> {
function board (line 117) | fn board(&self, board: BoardId) -> Result<RefMut<Ec<Box<dyn Access>>>, S...
method boards (line 128) | fn boards(&self) -> Result<Vec<BoardId>, String> {
method model (line 132) | fn model(&self, board: BoardId) -> Result<String, String> {
method version (line 141) | fn version(&self, board: BoardId) -> Result<String, String> {
method keymap_get (line 150) | fn keymap_get(&self, board: BoardId, layer: u8, output: u8, input: u8) -...
method keymap_set (line 155) | fn keymap_set(
method matrix_get (line 167) | fn matrix_get(&self, board: BoardId) -> Result<Matrix, String> {
method benchmark (line 179) | fn benchmark(&self, _board: BoardId) -> Result<Benchmark, String> {
method nelson (line 183) | fn nelson(&self, board: BoardId, kind: NelsonKind) -> Result<Nelson, Str...
method color (line 240) | fn color(&self, board: BoardId, index: u8) -> Result<(u8, u8, u8), Strin...
method set_color (line 245) | fn set_color(&self, board: BoardId, index: u8, color: (u8, u8, u8)) -> R...
method max_brightness (line 253) | fn max_brightness(&self, board: BoardId) -> Result<i32, String> {
method brightness (line 265) | fn brightness(&self, board: BoardId, index: u8) -> Result<i32, String> {
method set_brightness (line 274) | fn set_brightness(&self, board: BoardId, index: u8, brightness: i32) -> ...
method mode (line 279) | fn mode(&self, board: BoardId, layer: u8) -> Result<(u8, u8), String> {
method set_mode (line 284) | fn set_mode(&self, board: BoardId, layer: u8, mode: u8, speed: u8) -> Re...
method led_save (line 289) | fn led_save(&self, board: BoardId) -> Result<(), String> {
method refresh (line 294) | fn refresh(&self) -> Result<(), String> {
method set_no_input (line 407) | fn set_no_input(&self, board: BoardId, no_input: bool) -> Result<(), Str...
method exit (line 412) | fn exit(&self) -> Result<(), String> {
function is_qmk_raw_interface (line 421) | fn is_qmk_raw_interface(interface: i32, usage_page: u16, usage: u16) -> ...
FILE: backend/src/deref_cell.rs
type DerefCell (line 7) | pub struct DerefCell<T>(OnceCell<T>);
function is_some (line 10) | pub fn is_some(&self) -> bool {
function set (line 15) | pub fn set(&self, value: T) {
method default (line 23) | fn default() -> Self {
type Target (line 29) | type Target = T;
function deref (line 32) | fn deref(&self) -> &T {
FILE: backend/src/key.rs
type Key (line 9) | pub struct Key {
method new (line 35) | pub(crate) fn new(
method board (line 119) | fn board(&self) -> Board {
method pressed (line 123) | pub fn pressed(&self) -> bool {
method color (line 130) | pub fn color(&self) -> Option<Hs> {
method set_color (line 134) | pub async fn set_color(&self, color: Option<Hs>) -> Result<(), String> {
method get_scancode (line 148) | pub fn get_scancode(&self, layer: usize) -> Option<(u16, String)> {
method set_scancode (line 158) | pub async fn set_scancode(&self, layer: usize, scancode_name: &str) ->...
FILE: backend/src/keymap.rs
function serialize (line 13) | pub fn serialize<S: Serializer>(color: &Hs, serializer: S) -> Result<S::...
function deserialize (line 17) | pub fn deserialize<'de, D: Deserializer<'de>>(deserializer: D) -> Result...
function serialize (line 26) | pub fn serialize<S: Serializer>(
function deserialize (line 37) | pub fn deserialize<'de, D: Deserializer<'de>>(
type KeyMapLayer (line 49) | pub struct KeyMapLayer {
type KeyMap (line 57) | pub struct KeyMap {
method from_reader (line 68) | pub fn from_reader<R: Read>(rdr: R) -> serde_json::Result<Self> {
method to_writer_pretty (line 73) | pub fn to_writer_pretty<W: Write>(&self, wtr: W) -> serde_json::Result...
method to_string_pretty (line 78) | pub fn to_string_pretty(&self) -> String {
type Error (line 84) | type Error = serde_json::Error;
method try_from (line 85) | fn try_from(s: &str) -> Result<Self, serde_json::Error> {
FILE: backend/src/layer.rs
type Layer (line 9) | pub struct Layer {
method new (line 19) | pub(crate) fn new(daemon: &dyn Daemon, board: &Board, layer: u8) -> Se...
method board (line 65) | fn board(&self) -> Board {
method mode (line 70) | pub fn mode(&self) -> Option<(&'static Mode, u8)> {
method set_mode (line 75) | pub async fn set_mode(&self, mode: &Mode, speed: u8) -> Result<(), Str...
method brightness (line 87) | pub fn brightness(&self) -> i32 {
method set_brightness (line 91) | pub async fn set_brightness(&self, brightness: i32) -> Result<(), Stri...
method color (line 103) | pub fn color(&self) -> Hs {
method set_color (line 107) | pub async fn set_color(&self, hs: Hs) -> Result<(), String> {
FILE: backend/src/layout/meta.rs
function num_layers_default (line 4) | fn num_layers_default() -> u8 {
type Meta (line 10) | pub struct Meta {
FILE: backend/src/layout/mod.rs
constant EC_PAUSE_DATE (line 15) | const EC_PAUSE_DATE: (u16, u16, u16) = (2022, 5, 23);
constant EC_FNLOCK_DATE (line 17) | const EC_FNLOCK_DATE: (u16, u16, u16) = (2023, 8, 1);
constant QK_MOD_TAP_LEGACY (line 19) | const QK_MOD_TAP_LEGACY: u16 = 0x6000;
constant QK_MOD_TAP_MAX_LEGACY (line 20) | const QK_MOD_TAP_MAX_LEGACY: u16 = 0x7FFF;
constant QK_MOD_TAP (line 21) | const QK_MOD_TAP: u16 = 0x2000;
constant QK_MOD_TAP_MAX (line 22) | const QK_MOD_TAP_MAX: u16 = 0x3FFF;
type Layout (line 39) | pub struct Layout {
method from_data (line 94) | pub fn from_data(
method from_dir (line 149) | pub fn from_dir<P: AsRef<Path>>(board: &str, dir: P) -> Self {
method from_board (line 178) | pub fn from_board(board: &str, version: &str) -> Option<Self> {
method scancode_to_name (line 200) | pub fn scancode_to_name(&self, scancode: u16) -> Option<String> {
method scancode_from_name (line 219) | pub fn scancode_from_name(&self, name: &str) -> Option<u16> {
method f_keys (line 237) | pub fn f_keys(&self) -> impl Iterator<Item = &str> {
method layout (line 248) | pub fn layout(&self) -> &HashMap<String, (u8, u8)> {
function parse_keymap_json (line 253) | fn parse_keymap_json(
function parse_ec_date (line 290) | fn parse_ec_date(version: &str) -> Option<(u16, u16, u16)> {
function keymap_remove_pause (line 305) | fn keymap_remove_pause(keymap: &mut KeyMap) {
function keymap_remove_fnlock (line 314) | fn keymap_remove_fnlock(keymap: &mut KeyMap) {
constant VERSIONS (line 328) | const VERSIONS: [&str; 3] = ["0.7.103", "0.7.104", "0.19.12"];
function layout_from_board (line 331) | fn layout_from_board() {
function default_keys_exist (line 340) | fn default_keys_exist() {
function qmk_has_ec_keycodes (line 356) | fn qmk_has_ec_keycodes() {
function color_brightness_keycodes (line 380) | fn color_brightness_keycodes() {
function has_all_layouts_in_dir (line 403) | fn has_all_layouts_in_dir() -> io::Result<()> {
function physical_layout_leds_logical (line 421) | fn physical_layout_leds_logical() {
function layout_has_f_keys (line 462) | fn layout_has_f_keys() {
FILE: backend/src/layout/physical_layout.rs
type PhysicalLayout (line 10) | pub(crate) struct PhysicalLayout {
method from_str (line 16) | pub fn from_str(physical_json: &str) -> Self {
type PhysicalLayoutKey (line 77) | pub(crate) struct PhysicalLayoutKey {
method logical_name (line 85) | pub fn logical_name(&self) -> String {
type PhysicalLayoutJson (line 95) | struct PhysicalLayoutJson(Vec<PhysicalLayoutEntry>);
type PhysicalLayoutEntry (line 99) | enum PhysicalLayoutEntry {
type PhysicalLayoutMeta (line 106) | pub(crate) struct PhysicalLayoutMeta {
type PhysicalRow (line 112) | struct PhysicalRow(Vec<PhysicalKeyEnum>);
type PhysicalKeyEnum (line 116) | enum PhysicalKeyEnum {
type PhysicalKeyMeta (line 122) | struct PhysicalKeyMeta {
FILE: backend/src/localize.rs
type Localizations (line 10) | struct Localizations;
function localizer (line 34) | pub fn localizer() -> Box<dyn Localizer> {
FILE: backend/src/matrix.rs
type Matrix (line 4) | pub struct Matrix {
method new (line 11) | pub fn new(rows: usize, cols: usize, data: Box<[u8]>) -> Self {
method rows (line 15) | pub fn rows(&self) -> usize {
method cols (line 19) | pub fn cols(&self) -> usize {
method get (line 23) | pub fn get(&self, row: usize, col: usize) -> Option<bool> {
method set (line 34) | pub fn set(&mut self, row: usize, col: usize, value: bool) {
FILE: backend/src/mode.rs
type Mode (line 7) | pub struct Mode {
method new (line 21) | const fn new(
method all (line 38) | pub fn all() -> &'static [Mode] {
method from_index (line 43) | pub fn from_index(index: u8) -> Option<&'static Self> {
method from_id (line 50) | pub fn from_id(id: &str) -> Option<&'static Self> {
method is_per_key (line 57) | pub fn is_per_key(&self) -> bool {
method is_disabled (line 61) | pub fn is_disabled(&self) -> bool {
FILE: backend/src/nelson.rs
type NelsonKind (line 8) | pub enum NelsonKind {
type Nelson (line 14) | pub struct Nelson {
method max_rows (line 21) | pub fn max_rows(&self) -> usize {
method max_cols (line 28) | pub fn max_cols(&self) -> usize {
method success (line 35) | pub fn success(&self, layout: &HashMap<std::string::String, (u8, u8)>)...
FILE: backend/src/rect.rs
type Rect (line 2) | pub struct Rect {
method new (line 10) | pub fn new(x: f64, y: f64, w: f64, h: f64) -> Self {
method contains (line 15) | pub fn contains(&self, x: f64, y: f64) -> bool {
FILE: build.rs
function main (line 1) | fn main() {
FILE: ffi/build.rs
function main (line 3) | fn main() {
FILE: ffi/src/lib.rs
function pop_keyboard_backlight_widget (line 6) | pub extern "C" fn pop_keyboard_backlight_widget() -> *mut gtk::ffi::GtkW...
FILE: layouts.py
function call_preprocessor (line 284) | def call_preprocessor(input: str) -> str:
function read_stripping_includes (line 287) | def read_stripping_includes(path: str) -> str:
function extract_scancodes (line 295) | def extract_scancodes(ecdir: str, is_qmk: bool) -> Tuple[typing.OrderedD...
function parse_layout_define (line 382) | def parse_layout_define(keymap_h: str, is_qmk) -> Tuple[List[str], List[...
function parse_led_config (line 395) | def parse_led_config(led_c: str, physical2: List[List[str]]) -> Dict[str...
function parse_keymap (line 408) | def parse_keymap(keymap_c: str, mapping: Dict[str, str], physical: List[...
function gen_layout_json (line 439) | def gen_layout_json(path: str, physical: List[str], physical2: List[List...
function gen_keymap_json (line 450) | def gen_keymap_json(path: str, scancodes: typing.OrderedDict[str, int]) ...
function gen_leds_json (line 455) | def gen_leds_json(path: str, leds: [str, List[int]]) -> None:
function gen_default_json (line 460) | def gen_default_json(path: str, board: str, keymap: Dict[str, List[str]]...
function update_meta_json (line 478) | def update_meta_json(meta_json: str, has_brightness: bool, has_color: bo...
function write_json_file (line 491) | def write_json_file(path: str, data, sort_keys=False):
function generate_layout_dir (line 497) | def generate_layout_dir(ecdir: str, board: str, is_qmk: bool) -> None:
FILE: macos/deploy.py
function copy (line 39) | def copy(srcdir, destdir, path):
function otool_recursive (line 49) | def otool_recursive(path, libs):
function shasum (line 60) | def shasum(path):
function newpath (line 66) | def newpath(path):
function deploy_with_deps (line 70) | def deploy_with_deps(binpath):
FILE: src/about_dialog.rs
function show_about_dialog (line 5) | pub fn show_about_dialog() {
FILE: src/backlight.rs
type BacklightInner (line 16) | pub struct BacklightInner {
constant NAME (line 38) | const NAME: &'static str = "S76Backlight";
type ParentType (line 39) | type ParentType = gtk::ListBox;
type Type (line 40) | type Type = Backlight;
method constructed (line 44) | fn constructed(&self) {
method dispose (line 176) | fn dispose(&self) {
method properties (line 180) | fn properties() -> &'static [glib::ParamSpec] {
method set_property (line 196) | fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::Pa...
method property (line 207) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method new (line 226) | pub fn new(board: Board) -> Self {
method inner (line 264) | fn inner(&self) -> &BacklightInner {
method board (line 268) | fn board(&self) -> &Board {
method mode (line 272) | pub fn mode(&self) -> &'static Mode {
method header_func (line 281) | fn header_func(&self, row: >k::ListBoxRow, before: Option<>k::ListBo...
method filter_func (line 292) | fn filter_func(&self, row: >k::ListBoxRow) -> bool {
method mode_speed_changed (line 310) | fn mode_speed_changed(&self) {
method brightness_changed (line 349) | fn brightness_changed(&self) {
method set_layer (line 365) | pub fn set_layer(&self, mut layer: usize) {
method update_per_key (line 391) | fn update_per_key(&self) {
method disable_color_clicked (line 408) | fn disable_color_clicked(&self) {
method led_save (line 423) | fn led_save(&self) {
FILE: src/configurator_app.rs
type ConfiguratorAppInner (line 10) | pub struct ConfiguratorAppInner {
constant NAME (line 18) | const NAME: &'static str = "S76ConfiguratorApp";
type ParentType (line 19) | type ParentType = gtk::Application;
type Type (line 20) | type Type = ConfiguratorApp;
method constructed (line 24) | fn constructed(&self) {
method handle_local_options (line 59) | fn handle_local_options(&self, opts: &glib::VariantDict) -> glib::ExitCo...
method startup (line 77) | fn startup(&self) {
method activate (line 128) | fn activate(&self) {
method new (line 149) | fn new() -> Self {
method inner (line 153) | fn inner(&self) -> &ConfiguratorAppInner {
method phony_board_names (line 157) | pub fn phony_board_names(&self) -> &[String] {
method debug_layers (line 161) | pub fn debug_layers(&self) -> bool {
method launch_test (line 165) | pub fn launch_test(&self) -> bool {
function macos_init (line 171) | fn macos_init() {
function windows_init (line 210) | fn windows_init() {
function run (line 229) | pub fn run() -> glib::ExitCode {
FILE: src/error_dialog.rs
function show_error_dialog (line 5) | pub fn show_error_dialog<W: IsA<gtk::Window>, E: Display>(parent: &W, ti...
FILE: src/keyboard.rs
type KeyboardInner (line 23) | pub struct KeyboardInner {
constant NAME (line 39) | const NAME: &'static str = "S76Keyboard";
type ParentType (line 40) | type ParentType = gtk::Box;
type Type (line 41) | type Type = Keyboard;
method constructed (line 45) | fn constructed(&self) {
method properties (line 139) | fn properties() -> &'static [glib::ParamSpec] {
method set_property (line 147) | fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::Pa...
method property (line 156) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method new (line 174) | pub fn new(board: Board, debug_layers: bool, launch_test: bool) -> Self {
method inner (line 251) | fn inner(&self) -> &KeyboardInner {
method handle_backend_event (line 255) | pub fn handle_backend_event(&self, event: BoardEvent) {
method action_group (line 268) | pub fn action_group(&self) -> &gio::ActionGroup {
method board (line 272) | pub fn board(&self) -> &Board {
method display_name (line 276) | pub fn display_name(&self) -> String {
method layout (line 286) | fn layout(&self) -> &Layout {
method window (line 290) | fn window(&self) -> Option<gtk::Window> {
method layer (line 294) | pub fn layer(&self) -> Option<usize> {
method selected (line 298) | pub fn selected(&self) -> SelectedKeys {
method layer_stack (line 302) | pub fn layer_stack(&self) -> >k::Stack {
method has_scancode (line 306) | pub fn has_scancode(&self, scancode_name: &str) -> bool {
method keymap_set (line 310) | pub async fn keymap_set(&self, key_index: usize, layer: usize, scancode_...
method export_keymap (line 321) | pub fn export_keymap(&self) -> KeyMap {
method import_keymap (line 325) | pub async fn import_keymap(&self, keymap: KeyMap) {
method import (line 402) | fn import(&self) {
method export (line 433) | fn export(&self) {
method reset (line 473) | pub async fn reset(&self) {
method invert_f_keys (line 477) | async fn invert_f_keys(&self) {
method update_selectable (line 512) | fn update_selectable(&self) {
method add_pages (line 529) | fn add_pages(&self, debug_layers: bool) {
method set_picker (line 565) | pub(super) fn set_picker(&self, picker: Option<&Picker>) {
method set_selected (line 577) | fn set_selected(&self, selected: SelectedKeys) {
FILE: src/keyboard_layer.rs
constant SCALE (line 13) | const SCALE: f64 = 64.;
constant MARGIN (line 14) | const MARGIN: f64 = 2.;
constant RADIUS (line 15) | const RADIUS: f64 = 4.;
constant HALF_KEYBOARD_VSPACING (line 16) | const HALF_KEYBOARD_VSPACING: f64 = 16.;
type KeyboardLayerInner (line 19) | pub struct KeyboardLayerInner {
constant NAME (line 32) | const NAME: &'static str = "S76KeyboardLayer";
type ParentType (line 33) | type ParentType = gtk::DrawingArea;
type Type (line 34) | type Type = KeyboardLayer;
method constructed (line 38) | fn constructed(&self) {
method properties (line 44) | fn properties() -> &'static [glib::ParamSpec] {
method set_property (line 56) | fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::Pa...
method property (line 70) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method draw (line 80) | fn draw(&self, cr: &cairo::Context) -> Propagation {
method button_press_event (line 154) | fn button_press_event(&self, evt: &gdk::EventButton) -> Propagation {
method request_mode (line 189) | fn request_mode(&self) -> gtk::SizeRequestMode {
method preferred_width (line 193) | fn preferred_width(&self) -> (i32, i32) {
method preferred_height (line 197) | fn preferred_height(&self) -> (i32, i32) {
method preferred_height_for_width (line 202) | fn preferred_height_for_width(&self, width: i32) -> (i32, i32) {
method preferred_width_for_height (line 211) | fn preferred_width_for_height(&self, _width: i32) -> (i32, i32) {
method new (line 224) | pub fn new(page: Page, board: Board) -> Self {
method inner (line 231) | fn inner(&self) -> &KeyboardLayerInner {
method page (line 235) | pub fn page(&self) -> Page {
method set_page (line 239) | pub fn set_page(&self, page: Page) {
method keys (line 244) | pub fn keys(&self) -> &[Key] {
method selected (line 248) | pub fn selected(&self) -> SelectedKeys {
method set_selected (line 252) | pub fn set_selected(&self, i: SelectedKeys) {
method set_selectable (line 258) | pub fn set_selectable(&self, selectable: bool) {
method keys_maximize (line 263) | fn keys_maximize<F: Fn(&Key) -> i32>(&self, cell: &OnceCell<i32>, cb: F)...
method wide_width (line 267) | fn wide_width(&self) -> i32 {
method wide_height (line 274) | fn wide_height(&self) -> i32 {
method narrow_width (line 281) | fn narrow_width(&self) -> i32 {
method narrow_height (line 292) | fn narrow_height(&self) -> i32 {
method key_position_wide (line 296) | fn key_position_wide(&self, k: &Key) -> Rect {
method key_position_narrow (line 305) | fn key_position_narrow(&self, k: &Key) -> Rect {
method key_position (line 315) | fn key_position(&self, k: &Key) -> Rect {
FILE: src/localize.rs
type Localizations (line 10) | struct Localizations;
function localizer (line 34) | pub fn localizer() -> Box<dyn Localizer> {
FILE: src/main.rs
function main (line 30) | fn main() -> glib::ExitCode {
function translate (line 49) | fn translate() {
FILE: src/main_window.rs
type Loader (line 20) | pub struct Loader(MainWindow, gtk::Box);
method drop (line 25) | fn drop(&mut self) {
type MainWindowInner (line 36) | pub struct MainWindowInner {
constant NAME (line 56) | const NAME: &'static str = "S76ConfiguratorMainWindow";
type ParentType (line 57) | type ParentType = gtk::ApplicationWindow;
type Type (line 58) | type Type = MainWindow;
method constructed (line 62) | fn constructed(&self) {
method destroy (line 219) | fn destroy(&self) {
method new (line 236) | pub fn new(app: &ConfiguratorApp) -> Self {
method inner (line 292) | fn inner(&self) -> &MainWindowInner {
method handle_backend_event_stream (line 296) | fn handle_backend_event_stream(&self, mut receiver: backend::Events, is_...
method handle_backend_event (line 305) | fn handle_backend_event(&self, event: backend::Event, is_dummy: bool) {
method show_keyboard_list (line 352) | fn show_keyboard_list(&self) {
method show_keyboard (line 366) | fn show_keyboard(&self, keyboard: &Keyboard) {
method add_keyboard (line 383) | fn add_keyboard(&self, board: Board) {
method remove_keyboard (line 451) | fn remove_keyboard(&self, id: BoardId) {
method add_flash_menu (line 471) | fn add_flash_menu(&self, board: Bootloaded) {
method remove_flash_menu (line 503) | fn remove_flash_menu(&self) {
method num_keyboards (line 507) | fn num_keyboards(&self) -> usize {
method display_loader (line 513) | pub fn display_loader(&self, text: &str) -> Loader {
function daemon (line 533) | fn daemon() -> (Backend, backend::Events) {
function daemon (line 545) | fn daemon() -> (Backend, backend::Events) {
FILE: src/page.rs
type Page (line 6) | pub enum Page {
method name (line 18) | pub fn name(&self) -> String {
method layer (line 31) | pub fn layer(&self) -> Option<usize> {
method is_debug (line 41) | pub fn is_debug(&self) -> bool {
method iter_all (line 48) | pub fn iter_all() -> impl Iterator<Item = Self> {
method get_label (line 62) | pub fn get_label(&self, key: &Key) -> String {
method default (line 80) | fn default() -> Self {
FILE: src/picker/mod.rs
type PickerInner (line 34) | pub struct PickerInner {
constant NAME (line 41) | const NAME: &'static str = "S76KeyboardPicker";
type ParentType (line 42) | type ParentType = gtk::Box;
type Type (line 43) | type Type = Picker;
method constructed (line 47) | fn constructed(&self) {
method new (line 81) | pub fn new() -> Self {
method inner (line 85) | fn inner(&self) -> &PickerInner {
method keyboard (line 89) | fn keyboard(&self) -> Option<Keyboard> {
method set_keyboard (line 97) | pub(crate) fn set_keyboard(&self, keyboard: Option<Keyboard>) {
method set_selected (line 117) | pub(crate) fn set_selected(&self, scancode_names: Vec<String>) {
method key_pressed (line 121) | fn key_pressed(&self, name: String) {
method default (line 144) | fn default() -> Self {
function picker_has_keys (line 156) | fn picker_has_keys() {
FILE: src/picker/picker_group.rs
type PickerGroup (line 7) | pub(super) struct PickerGroup {
method new (line 15) | pub fn new(name: String, cols: u32) -> Self {
method add_key (line 48) | pub fn add_key(&mut self, key: Rc<PickerKey>) {
method iter_keys (line 53) | pub fn iter_keys(&self) -> impl Iterator<Item = &PickerKey> {
method invalidate_filter (line 57) | pub fn invalidate_filter(&self) {
FILE: src/picker/picker_group_box.rs
constant DEFAULT_COLS (line 15) | const DEFAULT_COLS: usize = 3;
constant HSPACING (line 16) | const HSPACING: i32 = 64;
constant VSPACING (line 17) | const VSPACING: i32 = 32;
constant PICKER_CSS (line 18) | const PICKER_CSS: &str = r#"
type PickerGroupBoxInner (line 31) | pub struct PickerGroupBoxInner {
constant NAME (line 39) | const NAME: &'static str = "S76KeyboardPickerGroupBox";
type ParentType (line 40) | type ParentType = gtk::Container;
type Type (line 41) | type Type = PickerGroupBox;
method constructed (line 45) | fn constructed(&self) {
method signals (line 89) | fn signals() -> &'static [Signal] {
method request_mode (line 100) | fn request_mode(&self) -> gtk::SizeRequestMode {
method preferred_width (line 104) | fn preferred_width(&self) -> (i32, i32) {
method preferred_height_for_width (line 121) | fn preferred_height_for_width(&self, width: i32) -> (i32, i32) {
method size_allocate (line 138) | fn size_allocate(&self, allocation: >k::Allocation) {
method realize (line 173) | fn realize(&self) {
method forall (line 197) | fn forall(&self, _include_internals: bool, cb: >k::subclass::container...
method remove (line 203) | fn remove(&self, child: >k::Widget) {
method new (line 214) | pub fn new() -> Self {
method inner (line 218) | fn inner(&self) -> &PickerGroupBoxInner {
method connect_signals (line 222) | fn connect_signals(&self) {
method connect_key_pressed (line 235) | pub fn connect_key_pressed<F: Fn(String) + 'static>(&self, cb: F) -> Sig...
method get_button (line 242) | fn get_button(&self, scancode_name: &str) -> Option<>k::Button> {
method set_key_visibility (line 246) | pub(crate) fn set_key_visibility<F: Fn(&str) -> bool>(&self, f: F) {
method set_selected (line 256) | pub(crate) fn set_selected(&self, scancode_names: Vec<String>) {
method rows_for_width (line 274) | fn rows_for_width(&self, container_width: i32) -> Vec<&[PickerGroup]> {
method default (line 303) | fn default() -> Self {
FILE: src/picker/picker_json.rs
type PickerJsonKey (line 4) | pub struct PickerJsonKey {
type PickerJsonGroup (line 10) | pub struct PickerJsonGroup {
function picker_json (line 17) | pub fn picker_json() -> Vec<PickerJsonGroup> {
function test_picker_json (line 27) | fn test_picker_json() {
FILE: src/picker/picker_key.rs
type PickerKey (line 5) | pub(super) struct PickerKey {
method new (line 13) | pub(super) fn new<P: IsA<gtk::StyleProvider>>(
FILE: src/shortcuts_window.rs
function shortcuts_window (line 4) | pub fn shortcuts_window() -> gtk::ShortcutsWindow {
FILE: src/testing.rs
type TestResults (line 17) | struct TestResults {
method global (line 22) | fn global() -> &'static Self {
method new (line 27) | fn new() -> Self {
method reset (line 35) | fn reset(&self) {
type TestingColors (line 55) | pub struct TestingColors(pub HashMap<(usize, usize), Rgb>);
type TestingInner (line 58) | pub struct TestingInner {
constant NAME (line 77) | const NAME: &'static str = "S76Testing";
type ParentType (line 78) | type ParentType = gtk::Box;
type Type (line 79) | type Type = Testing;
method constructed (line 83) | fn constructed(&self) {
method properties (line 263) | fn properties() -> &'static [glib::ParamSpec] {
method property (line 273) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method update_benchmarks (line 291) | fn update_benchmarks(&self) {
method bench (line 308) | async fn bench(&self) {
method connect_bench_button (line 363) | fn connect_bench_button(&self) {
method test_buttons_sensitive (line 373) | fn test_buttons_sensitive(&self, sensitive: bool) {
method nelson (line 380) | async fn nelson(&self, test_runs: i32, test_index: usize, nelson_kind: N...
method connect_test_button_1 (line 456) | fn connect_test_button_1(&self) {
method connect_test_button_2 (line 466) | fn connect_test_button_2(&self) {
method selma_update_colors (line 480) | pub fn selma_update_colors(&self) {
method selma (line 498) | async fn selma(&self) {
method connect_selma_buttons (line 527) | fn connect_selma_buttons(&self) {
method connect_reset_button (line 547) | fn connect_reset_button(&self) {
method new (line 555) | pub fn new(board: &Board, keyboard: &Keyboard) -> Self {
method inner (line 571) | fn inner(&self) -> &TestingInner {
method keyboard (line 576) | fn keyboard(&self) -> Keyboard {
method set_no_input (line 580) | async fn set_no_input(&self, no_input: bool) {
FILE: tools/src/pkgconfig.rs
constant PKGCONFIG (line 7) | const PKGCONFIG: &str = r#"Name: ${name}
function main (line 13) | fn main() -> io::Result<()> {
FILE: widgets/examples/keyboard_color.rs
function main (line 8) | fn main() -> glib::ExitCode {
FILE: widgets/src/choose_color.rs
function choose_color (line 14) | pub async fn choose_color<W: IsA<gtk::Widget>>(
FILE: widgets/src/color_circle.rs
constant BORDER (line 7) | const BORDER: f64 = 1.;
type ColorCircleInner (line 10) | pub struct ColorCircleInner {
constant NAME (line 16) | const NAME: &'static str = "S76ColorCircle";
type ParentType (line 17) | type ParentType = gtk::Button;
type Type (line 18) | type Type = ColorCircle;
method draw (line 24) | fn draw(&self, cr: &cairo::Context) -> Propagation {
method new (line 75) | pub fn new(size: i32) -> Self {
method inner (line 82) | fn inner(&self) -> &ColorCircleInner {
method set_colors (line 86) | pub fn set_colors(&self, colors: BTreeSet<Hs>) {
FILE: widgets/src/color_wheel.rs
type ColorWheelInner (line 18) | pub struct ColorWheelInner {
constant NAME (line 29) | const NAME: &'static str = "S76ColorWheel";
type ParentType (line 30) | type ParentType = gtk::DrawingArea;
type Type (line 31) | type Type = ColorWheel;
method constructed (line 35) | fn constructed(&self) {
method properties (line 56) | fn properties() -> &'static [glib::ParamSpec] {
method set_property (line 77) | fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::Pa...
method property (line 99) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method draw (line 114) | fn draw(&self, cr: &cairo::Context) -> Propagation {
method size_allocate (line 152) | fn size_allocate(&self, rect: &gdk::Rectangle) {
method request_mode (line 168) | fn request_mode(&self) -> gtk::SizeRequestMode {
method preferred_width (line 172) | fn preferred_width(&self) -> (i32, i32) {
method preferred_height (line 176) | fn preferred_height(&self) -> (i32, i32) {
method preferred_height_for_width (line 180) | fn preferred_height_for_width(&self, width: i32) -> (i32, i32) {
method preferred_width_for_height (line 184) | fn preferred_width_for_height(&self, height: i32) -> (i32, i32) {
method new (line 197) | pub fn new() -> Self {
method inner (line 201) | fn inner(&self) -> &ColorWheelInner {
method hs (line 205) | pub fn hs(&self) -> Hs {
method set_hs (line 209) | pub fn set_hs(&self, hs: Hs) {
method connect_hs_changed (line 217) | pub fn connect_hs_changed<F: Fn(&Self) + 'static>(&self, f: F) {
method mouse_select (line 221) | fn mouse_select(&self, pos: (f64, f64)) {
method generate_surface (line 234) | async fn generate_surface(&self, rect: >k::Rectangle) -> cairo::ImageS...
method default (line 273) | fn default() -> Self {
FILE: widgets/src/keyboard_backlight_widget.rs
function keyboard_backlight_widget (line 14) | pub fn keyboard_backlight_widget() -> gtk::Widget {
function add_boards (line 39) | fn add_boards(stack: >k::Stack) -> Result<(), String> {
function page (line 54) | fn page(board: Board) -> gtk::Widget {
function row (line 89) | fn row<W: IsA<gtk::Widget>>(text: &str, widget: &W, expand: bool) -> gtk...
FILE: widgets/src/keyboard_color.rs
type KeyboardColorIndex (line 19) | pub enum KeyboardColorIndex {
method set_color (line 25) | pub async fn set_color(&self, board: &Board, hs: Hs) -> Result<(), Str...
method get_color_set (line 39) | pub fn get_color_set(&self, board: &Board) -> BTreeSet<Hs> {
method get_colors (line 52) | pub fn get_colors(&self, board: &Board) -> HashMap<usize, Hs> {
method set_colors (line 65) | pub async fn set_colors(
method default (line 89) | fn default() -> Self {
type KeyboardColorInner (line 95) | pub struct KeyboardColorInner {
constant NAME (line 105) | const NAME: &'static str = "S76KeyboardColor";
type ParentType (line 106) | type ParentType = gtk::Bin;
type Type (line 107) | type Type = KeyboardColor;
method constructed (line 111) | fn constructed(&self) {
method properties (line 125) | fn properties() -> &'static [glib::ParamSpec] {
method set_property (line 133) | fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::Pa...
method property (line 143) | fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value {
method destroy (line 152) | fn destroy(&self) {
method new (line 166) | pub fn new(board: Option<Board>, index: KeyboardColorIndex) -> Self {
method inner (line 174) | fn inner(&self) -> &KeyboardColorInner {
method circle_clicked (line 178) | fn circle_clicked(&self) {
method board (line 201) | fn board(&self) -> Option<Ref<Board>> {
method set_board (line 210) | pub fn set_board(&self, board: Option<Board>) {
method hs (line 216) | fn hs(&self) -> Hs {
method set_hs (line 220) | fn set_hs(&self, hs: Hs) {
method index (line 238) | fn index(&self) -> Ref<KeyboardColorIndex> {
method read_color (line 242) | fn read_color(&self) {
method set_index (line 257) | pub fn set_index(&self, value: KeyboardColorIndex) {
method cancel_dialog (line 262) | pub fn cancel_dialog(&self) {
FILE: widgets/src/localize.rs
type Localizations (line 10) | struct Localizations;
function localizer (line 34) | pub fn localizer() -> Box<dyn Localizer> {
FILE: widgets/src/selected_keys.rs
type SelectedKeys (line 6) | pub struct SelectedKeys(BTreeSet<usize>);
method new (line 9) | pub fn new() -> Self {
type Target (line 15) | type Target = BTreeSet<usize>;
method deref (line 17) | fn deref(&self) -> &Self::Target {
method deref_mut (line 23) | fn deref_mut(&mut self) -> &mut Self::Target {
FILE: windows/build.py
function find_depends (line 65) | def find_depends(exe):
function check_call (line 78) | def check_call(args, **kwargs):
function copy (line 103) | def copy(srcdir, destdir, path):
function strip (line 113) | def strip(srcdir, destdir, path):
function add_files (line 156) | def add_files(dirpath, indent):
Condensed preview — 316 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,368K chars).
[
{
"path": ".cargo/config",
"chars": 97,
"preview": "[target.'cfg(target_os = \"macos\")']\nrustflags = [\"-C\", \"link-args=-headerpad_max_install_names\"]\n"
},
{
"path": ".github/workflows/ci.yml",
"chars": 8801,
"preview": "on:\n push:\n branches: '**'\n tags-ignore: '**'\n pull_request:\n release:\n types: [published]\n\nname: ci\n\nenv:\n "
},
{
"path": ".github/workflows/version.py",
"chars": 298,
"preview": "#!/usr/bin/env python3\n\nimport json\nimport subprocess\n\nmeta_str = subprocess.check_output([\"cargo\", \"metadata\", \"--forma"
},
{
"path": ".gitignore",
"chars": 844,
"preview": "/result\n/target\n/linux/system76-keyboard-configurator\n/windows/out\n/windows/sign\n/windows/libraries.wxi\n/windows/*.png\n/"
},
{
"path": "Cargo.toml",
"chars": 1054,
"preview": "[package]\nname = \"system76-keyboard-configurator\"\nversion = \"1.3.13\"\nauthors = [\"Ian Douglas Scott <idscott@system76.com"
},
{
"path": "LICENSE",
"chars": 35149,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Makefile",
"chars": 1821,
"preview": "prefix ?= /usr/local\nbindir = $(prefix)/bin\nlibdir = $(prefix)/lib\nincludedir = $(prefix)/include\ndatarootdir = $(prefix"
},
{
"path": "README.md",
"chars": 1345,
"preview": "# System76 Keyboard Configurator\n\nTool for configuring System76 keyboards, internal and external, with support for chang"
},
{
"path": "RELEASING.md",
"chars": 536,
"preview": "# Releasing\n\n* Make sure all builds and tests are passing on CI.\n* Update version in `Cargo.toml`.\n* Add new release to "
},
{
"path": "backend/Cargo.toml",
"chars": 1152,
"preview": "[package]\nname = \"system76-keyboard-configurator-backend\"\nversion = \"0.1.0\"\nauthors = [\"Ian Douglas Scott <idscott@syste"
},
{
"path": "backend/build.rs",
"chars": 1357,
"preview": "use std::{\n env,\n fs::{self, File},\n io::Write,\n path::Path,\n};\n\nfn main() {\n let out_dir = env::var_os(\""
},
{
"path": "backend/examples/benchmark.rs",
"chars": 330,
"preview": "use std::io;\n\nuse system76_keyboard_configurator_backend::Benchmark;\n\nfn benchmark() -> io::Result<()> {\n let benchma"
},
{
"path": "backend/examples/daemon.rs",
"chars": 838,
"preview": "use std::env;\nuse system76_keyboard_configurator_backend::{run_daemon, Backend, Events};\n\n#[cfg(target_os = \"linux\")]\nfn"
},
{
"path": "backend/i18n.toml",
"chars": 58,
"preview": "fallback_language = \"en\"\n\n[fluent]\nassets_dir = \"../i18n\"\n"
},
{
"path": "backend/src/backend.rs",
"chars": 3590,
"preview": "use futures::{\n channel::mpsc as async_mpsc,\n stream::{FusedStream, Stream},\n};\nuse std::{\n pin::Pin,\n proce"
},
{
"path": "backend/src/benchmark/block_dev.rs",
"chars": 1415,
"preview": "#[cfg(target_os = \"linux\")]\nuse std::os::unix::fs::OpenOptionsExt;\nuse std::{\n alloc::{alloc, dealloc, handle_alloc_e"
},
{
"path": "backend/src/benchmark/mod.rs",
"chars": 3399,
"preview": "use serde::{Deserialize, Serialize};\nuse std::{collections::BTreeMap, io};\n\nuse self::usb_hub::UsbHub;\n\nmod block_dev;\nm"
},
{
"path": "backend/src/benchmark/usb_dev.rs",
"chars": 3659,
"preview": "use std::{\n fs, io,\n path::{Path, PathBuf},\n};\n\nuse super::block_dev::BlockDev;\n\npub struct UsbDev(PathBuf);\n\nimpl"
},
{
"path": "backend/src/benchmark/usb_hub.rs",
"chars": 2645,
"preview": "use std::{collections::BTreeMap, fs, io, path::Path};\n\nuse super::usb_dev::UsbDev;\n\nconst SYSTEM76_VID: u16 = 0x3384;\nco"
},
{
"path": "backend/src/board.rs",
"chars": 8141,
"preview": "use futures::channel::mpsc as async_mpsc;\nuse once_cell::sync::{Lazy, OnceCell};\nuse regex::Regex;\nuse serde::{Deseriali"
},
{
"path": "backend/src/color.rs",
"chars": 4038,
"preview": "use ordered_float::NotNan;\nuse palette::{Component, IntoColor, RgbHue};\nuse serde::{de, Deserialize, Serialize};\nuse std"
},
{
"path": "backend/src/daemon/client.rs",
"chars": 2396,
"preview": "use std::{\n cell::RefCell,\n env,\n io::{BufRead, BufReader, Write},\n path::PathBuf,\n process::{Child, Chil"
},
{
"path": "backend/src/daemon/daemon_thread.rs",
"chars": 15149,
"preview": "use futures::{\n channel::{mpsc as async_mpsc, oneshot},\n executor::LocalPool,\n future::{abortable, AbortHandle}"
},
{
"path": "backend/src/daemon/dummy.rs",
"chars": 5675,
"preview": "use std::{cell::RefCell, collections::HashMap};\n\nuse super::{BoardId, Daemon};\nuse crate::{fl, Benchmark, Layout, Matrix"
},
{
"path": "backend/src/daemon/mod.rs",
"chars": 3775,
"preview": "use serde::{Deserialize, Serialize};\n\nuse crate::{Benchmark, Matrix, Nelson, NelsonKind};\n\nmod client;\nmod daemon_thread"
},
{
"path": "backend/src/daemon/s76power.rs",
"chars": 5811,
"preview": "// Note: Linux only\n// Need to watch properties of each object?\n// TODO: Hotplug detection support\n\nuse std::iter::Itera"
},
{
"path": "backend/src/daemon/server.rs",
"chars": 15605,
"preview": "#[cfg(target_os = \"linux\")]\nuse ectool::AccessLpcLinux;\nuse ectool::{Access, AccessHid, Ec};\nuse hidapi::{DeviceInfo, Hi"
},
{
"path": "backend/src/deref_cell.rs",
"chars": 759,
"preview": "use once_cell::unsync::OnceCell;\n\n/// Wrapper around `OnceCell` implementing `Deref`, and thus also panicking\n/// when n"
},
{
"path": "backend/src/key.rs",
"chars": 5613,
"preview": "use std::sync::{\n atomic::{AtomicU16, Ordering},\n Mutex,\n};\n\nuse crate::{Board, BoardEvent, Daemon, Hs, PhysicalLa"
},
{
"path": "backend/src/keymap.rs",
"chars": 2401,
"preview": "use serde::{Deserialize, Deserializer, Serialize, Serializer};\nuse std::{\n collections::BTreeMap,\n convert::TryFro"
},
{
"path": "backend/src/layer.rs",
"chars": 3575,
"preview": "use std::sync::{\n atomic::{AtomicI32, Ordering},\n Mutex,\n};\n\nuse crate::{Board, Daemon, Hs, Mode, Rgb, WeakBoard};"
},
{
"path": "backend/src/layout/meta.rs",
"chars": 1002,
"preview": "use crate::Rgb;\nuse serde::Deserialize;\n\nfn num_layers_default() -> u8 {\n 2\n}\n\n/// Metadata for keyboard\n#[derive(Deb"
},
{
"path": "backend/src/layout/mod.rs",
"chars": 16076,
"preview": "use cascade::cascade;\nuse regex::Regex;\nuse std::{collections::HashMap, convert::TryFrom, fs, path::Path, str::FromStr};"
},
{
"path": "backend/src/layout/physical_layout.rs",
"chars": 3745,
"preview": "//! Serde based deserialization for physical.json\n//! From <http://www.keyboard-layout-editor.com>\nuse serde::Deserializ"
},
{
"path": "backend/src/lib.rs",
"chars": 1004,
"preview": "//#![warn(missing_docs)]\n\n//! ```no_run\n//! # use futures::{executor::ThreadPool, stream::StreamExt};\n//! use system76_k"
},
{
"path": "backend/src/localize.rs",
"chars": 1003,
"preview": "use i18n_embed::{\n fluent::{fluent_language_loader, FluentLanguageLoader},\n DefaultLocalizer, LanguageLoader, Loca"
},
{
"path": "backend/src/matrix.rs",
"chars": 1128,
"preview": "use serde::{Deserialize, Serialize};\n\n#[derive(Deserialize, Serialize, Debug, Default, PartialEq, Clone)]\npub struct Mat"
},
{
"path": "backend/src/mode.rs",
"chars": 3123,
"preview": "use crate::fl;\nuse once_cell::sync::Lazy;\nuse std::collections::HashMap;\n\n/// A mode/pattern for the keyboard's LEDs to "
},
{
"path": "backend/src/nelson.rs",
"chars": 1172,
"preview": "use serde::{Deserialize, Serialize};\nuse std::cmp;\nuse std::collections::HashMap;\n\nuse crate::Matrix;\n\n#[derive(Clone, C"
},
{
"path": "backend/src/rect.rs",
"chars": 424,
"preview": "#[derive(Copy, Clone, Debug)]\npub struct Rect {\n pub x: f64,\n pub y: f64,\n pub w: f64,\n pub h: f64,\n}\n\nimpl "
},
{
"path": "build.rs",
"chars": 175,
"preview": "fn main() {\n glib_build_tools::compile_resources(\n &[\"data\"],\n \"data/com.system76.keyboardconfigurator."
},
{
"path": "data/com.system76.keyboardconfigurator.gresource.xml",
"chars": 291,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<gresources>\n <gresource prefix=\"/com/system76/keyboardconfigurator\">\n <f"
},
{
"path": "data/system76_launch_1_default.hex",
"chars": 71208,
"preview": ":100000000C9458030C949F030C949F030C949F032F\r\n:100010000C949F030C949F030C949F030C949F03D8\r\n:100020000C949F030C949F030C949"
},
{
"path": "data/system76_launch_2_default.hex",
"chars": 82947,
"preview": ":100000000C944E030C9495030C9495030C94950357\r\n:100010000C9495030C9495030C9495030C94950300\r\n:100020000C9495030C9495030C94F"
},
{
"path": "data/system76_launch_heavy_1_default.hex",
"chars": 85250,
"preview": ":100000000C94AA040C94F1040C94F1040C94F104E3\r\n:100010000C94F1040C94F1040C94F1040C94F1048C\r\n:100020000C94F1040C94F1040C943"
},
{
"path": "data/system76_launch_lite_1_default.hex",
"chars": 64515,
"preview": ":100000000C941B030C9462030C9462030C94620323\r\n:100010000C9462030C9462030C9462030C946203CC\r\n:100020000C9462030C9462030C941"
},
{
"path": "debian/changelog",
"chars": 2558,
"preview": "system76-keyboard-configurator (1.3.13) jammy; urgency=medium\n\n * 1.3.13 release.\n\n -- Ian Douglas Scott <idscott@syste"
},
{
"path": "debian/com.system76.pkexec.keyboardconfigurator.policy",
"chars": 800,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE policyconfig PUBLIC\n \"-//freedesktop//DTD PolicyKit Policy Configuratio"
},
{
"path": "debian/compat",
"chars": 3,
"preview": "11\n"
},
{
"path": "debian/control",
"chars": 1305,
"preview": "Source: system76-keyboard-configurator\nSection: admin\nPriority: optional\nMaintainer: System76 <info@system76.com>\nBuild-"
},
{
"path": "debian/copyright",
"chars": 236,
"preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: system76-keyboard-configurator\n"
},
{
"path": "debian/libsystem76-keyboard-configurator-dev.install",
"chars": 12,
"preview": "usr/include\n"
},
{
"path": "debian/libsystem76-keyboard-configurator.install",
"chars": 97,
"preview": "usr/lib/libsystem76_keyboard_configurator.so\nusr/lib/pkgconfig/system76_keyboard_configurator.pc\n"
},
{
"path": "debian/libsystem76-keyboard-configurator.trigger",
"chars": 8,
"preview": "ldconfig"
},
{
"path": "debian/rules",
"chars": 349,
"preview": "#!/usr/bin/make -f\n\nCLEAN ?= 1\nVENDOR ?= 1\n\n%:\n\tdh $@\n\noverride_dh_auto_clean:\nifeq ($(CLEAN),1)\n\tmake clean\nendif\nifeq "
},
{
"path": "debian/source/format",
"chars": 13,
"preview": "3.0 (native)\n"
},
{
"path": "debian/source/options",
"chars": 64,
"preview": "tar-ignore = \".git\"\ntar-ignore = \"target\"\ntar-ignore = \"vendor\"\n"
},
{
"path": "debian/system76-keyboard-configurator.install",
"chars": 583,
"preview": "usr/bin/system76-keyboard-configurator\nusr/share/applications/com.system76.keyboardconfigurator.desktop\nusr/share/metain"
},
{
"path": "debian/test-launch-system76-keyboard-configurator.install",
"chars": 82,
"preview": "linux/com.system76.keyboardconfiguratorlaunchtest.desktop usr/share/applications/\n"
},
{
"path": "ffi/Cargo.toml",
"chars": 282,
"preview": "[package]\nname = \"ffi\"\nversion = \"0.1.0\"\nauthors = [\"Ian Douglas Scott <idscott@system76.com>\"]\nedition = \"2021\"\n\n[lib]\n"
},
{
"path": "ffi/build.rs",
"chars": 595,
"preview": "use std::{env, fs::File, io::Write, path::PathBuf};\n\nfn main() {\n let target_dir = PathBuf::from(\"../target\");\n\n l"
},
{
"path": "ffi/src/lib.rs",
"chars": 379,
"preview": "use gtk::glib::object::ObjectType;\nuse std::mem;\nuse system76_keyboard_configurator_widgets::keyboard_backlight_widget;\n"
},
{
"path": "ffi/system76_keyboard_configurator.h",
"chars": 80,
"preview": "#pragma once\n\n#include <gtk/gtk.h>\n\nGtkWidget *pop_keyboard_backlight_widget ();"
},
{
"path": "ffi/system76_keyboard_configurator.pc.in",
"chars": 114,
"preview": "Name: {name}\nDescription: {description}\nVersion: {version}\nCflags: -I${{includedir}}\nLibs: -L${{libdir}} -l{name}\n"
},
{
"path": "flake.nix",
"chars": 1020,
"preview": "{\n description = \"System76 Keyboard Configurator\";\n\n inputs = {\n flake-utils.url = \"github:numtide/flake-utils\";\n "
},
{
"path": "i18n/cs/system76_keyboard_configurator.ftl",
"chars": 2942,
"preview": "-name = Nastavení Klávesnice\n\napp-about = O {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, falešný\n\nbutton"
},
{
"path": "i18n/cs/system76_keyboard_configurator_backend.ftl",
"chars": 514,
"preview": "mode-disabled = Vypnuto\nmode-solid-color = Celé rozložení\nmode-per-key = Každá klávesa\nmode-active-keys = Nastavené kláv"
},
{
"path": "i18n/cs/system76_keyboard_configurator_widgets.ftl",
"chars": 277,
"preview": "button-color = Barva\nbutton-cancel = Zrušit\nbutton-save = Uložit\n\nchoose-color = Nastavit barvu\n\nerror-set-color = Nasta"
},
{
"path": "i18n/da/system76_keyboard_configurator.ftl",
"chars": 3243,
"preview": "-name = Keyboard Konfigureringsværktøj\n\napp-about = Om {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, Fals"
},
{
"path": "i18n/da/system76_keyboard_configurator_backend.ftl",
"chars": 532,
"preview": "mode-disabled = Slået fra\nmode-solid-color = Per Lag Solid Farve\nmode-per-key = Per Tast Solid\nmode-active-keys = Kun Bu"
},
{
"path": "i18n/da/system76_keyboard_configurator_widgets.ftl",
"chars": 280,
"preview": "button-color = Farve\nbutton-cancel = Annuller\nbutton-save = Gem\n\nchoose-color = Set Farve\n\nerror-set-color = Fejlede i a"
},
{
"path": "i18n/de/system76_keyboard_configurator.ftl",
"chars": 3182,
"preview": "-name = Tastatur-Konfigurator\n\napp-about = Über {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, Fälschung\n\n"
},
{
"path": "i18n/de/system76_keyboard_configurator_backend.ftl",
"chars": 577,
"preview": "mode-disabled = Deaktiviert\nmode-solid-color = Schichtbezogene Volltonfarbe\nmode-per-key = Tastenbezogene Volltonfarbe\nm"
},
{
"path": "i18n/de/system76_keyboard_configurator_widgets.ftl",
"chars": 323,
"preview": "button-color = Farbe\nbutton-cancel = Abbrechen\nbutton-save = Speichern\n\nchoose-color = Farbe auswählen\n\nerror-set-color "
},
{
"path": "i18n/en/system76_keyboard_configurator.ftl",
"chars": 3081,
"preview": "-name = Keyboard Configurator\n\napp-about = About {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, fake\n\nbutt"
},
{
"path": "i18n/en/system76_keyboard_configurator_backend.ftl",
"chars": 531,
"preview": "mode-disabled = Disabled\nmode-solid-color = Per Layer Solid Color\nmode-per-key = Per Key Solid\nmode-active-keys = Bound "
},
{
"path": "i18n/en/system76_keyboard_configurator_widgets.ftl",
"chars": 271,
"preview": "button-color = Color\nbutton-cancel = Cancel\nbutton-save = Save\n\nchoose-color = Set Color\n\nerror-set-color = Failed to se"
},
{
"path": "i18n/es/system76_keyboard_configurator.ftl",
"chars": 3160,
"preview": "-name = Configurador del teclado\n\napp-about = Acerca de {-name}\napp-title = {-name} System76\n\nboard-fake = {$model}, fal"
},
{
"path": "i18n/es/system76_keyboard_configurator_backend.ftl",
"chars": 575,
"preview": "mode-disabled = Desabilitado\nmode-solid-color = Color sólido por capa\nmode-per-key = Sólido por tecla\nmode-active-keys ="
},
{
"path": "i18n/es/system76_keyboard_configurator_widgets.ftl",
"chars": 290,
"preview": "button-color = Color\nbutton-cancel = Cancelar\nbutton-save = Guardar\n\nchoose-color = Escoger un color\n\nerror-set-color = "
},
{
"path": "i18n/fi/system76_keyboard_configurator.ftl",
"chars": 3603,
"preview": "-name = Näppäimistön Konfiguraattori\n\napp-about = Tietoa {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, vä"
},
{
"path": "i18n/fi/system76_keyboard_configurator_backend.ftl",
"chars": 586,
"preview": "mode-disabled = Pois Käytöstä\nmode-solid-color = Yksivärisyys Per Kerros\nmode-per-key = Yksivärisyys Per Näppäin\nmode-ac"
},
{
"path": "i18n/fi/system76_keyboard_configurator_widgets.ftl",
"chars": 308,
"preview": "button-color = Väri\nbutton-cancel = Peruuta\nbutton-save = Tallenna\n\nchoose-color = Aseta Väri\n\nerror-set-color = Näppäim"
},
{
"path": "i18n/fr/system76_keyboard_configurator.ftl",
"chars": 3112,
"preview": "-name = Configurateur de clavier\n\napp-about = À propos du {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, s"
},
{
"path": "i18n/fr/system76_keyboard_configurator_backend.ftl",
"chars": 608,
"preview": "mode-disabled = Désactiver\nmode-solid-color = Couleur solide par couche\nmode-per-key = Solide par touche\nmode-active-key"
},
{
"path": "i18n/fr/system76_keyboard_configurator_widgets.ftl",
"chars": 345,
"preview": "button-color = Couleur\nbutton-cancel = Annuler\nbutton-save = Sauvegarder\n\nchoose-color = Choisir la couleur\n\nerror-set-c"
},
{
"path": "i18n/hu/system76_keyboard_configurator.ftl",
"chars": 3661,
"preview": "-name = Billentyűzet-konfigurátor\n\napp-about = A {-name} névjegye\napp-title = System76 {-name}\n\nboard-fake = {$model}, h"
},
{
"path": "i18n/hu/system76_keyboard_configurator_backend.ftl",
"chars": 575,
"preview": "mode-disabled = Letiltva\nmode-solid-color = Egységes szín rétegenként\nmode-per-key = Egyedi szín billentyűnként\nmode-act"
},
{
"path": "i18n/hu/system76_keyboard_configurator_widgets.ftl",
"chars": 314,
"preview": "button-color = Szín\nbutton-cancel = Mégse\nbutton-save = Mentés\n\nchoose-color = Szín beállítása\n\nerror-set-color = Nem si"
},
{
"path": "i18n/it/system76_keyboard_configurator.ftl",
"chars": 3596,
"preview": "-name = Configuratore Tastiera\n\napp-about = About {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, falso\n\nbu"
},
{
"path": "i18n/it/system76_keyboard_configurator_backend.ftl",
"chars": 586,
"preview": "mode-disabled = Disabilitato\nmode-solid-color = Tinta Unita Per Strato\nmode-per-key = Colore Per Tasto\nmode-active-keys "
},
{
"path": "i18n/it/system76_keyboard_configurator_widgets.ftl",
"chars": 313,
"preview": "button-color = Colore\nbutton-cancel = Annulla\nbutton-save = Salva\n\nchoose-color = Imposta Colore\n\nerror-set-color = Impo"
},
{
"path": "i18n/ko/system76_keyboard_configurator.ftl",
"chars": 2447,
"preview": "-name = 키보드 설정기\n\napp-about = {-name} 정보\napp-title = System76 {-name}\n\nboard-fake = {$model}, fake\n\nbutton-cancel = 취소\nbu"
},
{
"path": "i18n/ko/system76_keyboard_configurator_backend.ftl",
"chars": 419,
"preview": "mode-disabled = 비활성화\nmode-solid-color = 레이어 단위 고정\nmode-per-key = 키 단위 고정\nmode-active-keys = 지정 키 전용\nmode-cycle-all = 코스믹"
},
{
"path": "i18n/ko/system76_keyboard_configurator_widgets.ftl",
"chars": 204,
"preview": "button-color = 색상\nbutton-cancel = 취소\nbutton-save = 저장\n\nchoose-color = 색상 선택\n\nerror-set-color = 키보드 색상 설정 실패\nerror-set-br"
},
{
"path": "i18n/nl/system76_keyboard_configurator.ftl",
"chars": 3718,
"preview": "-name = Toetsenbordconfigurator\n\napp-about = Over {-name}\napp-title = System76 - {-name}\n\nboard-fake = {$model}, namaak\n"
},
{
"path": "i18n/nl/system76_keyboard_configurator_backend.ftl",
"chars": 601,
"preview": "mode-disabled = Uitgeschakeld\nmode-solid-color = Vaste kleur per laag\nmode-per-key = Vaste kleur per toets\nmode-active-k"
},
{
"path": "i18n/nl/system76_keyboard_configurator_widgets.ftl",
"chars": 297,
"preview": "button-color = Kleur\nbutton-cancel = Annuleren\nbutton-save = Opslaan\n\nchoose-color = Kleur instellen\n\nerror-set-color = "
},
{
"path": "i18n/pl/system76_keyboard_configurator.ftl",
"chars": 2761,
"preview": "-name = Konfiguracja Klawiatury\napp-about = Na temat {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, imitac"
},
{
"path": "i18n/pl/system76_keyboard_configurator_backend.ftl",
"chars": 593,
"preview": "mode-disabled = Zablokowany\nmode-solid-color = Jednolity Kolor na warstwę\nmode-per-key = Jednolity Kolor na klawisz\nmode"
},
{
"path": "i18n/pl/system76_keyboard_configurator_widgets.ftl",
"chars": 282,
"preview": "button-color = Kolor\nbutton-cancel = Anuluj\nbutton-save = Zapisz\n\nchoose-color = Ustaw Kolor\n\nerror-set-color = Błąd ust"
},
{
"path": "i18n/pt-BR/system76_keyboard_configurator.ftl",
"chars": 3203,
"preview": "-name = Configurador do Teclado\n\napp-about = Sobre {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, falso\n\nb"
},
{
"path": "i18n/pt-BR/system76_keyboard_configurator_backend.ftl",
"chars": 572,
"preview": "mode-disabled = Desabilitado\nmode-solid-color = Cor Sólida por Camada\nmode-per-key = Sólido por Tecla\nmode-active-keys ="
},
{
"path": "i18n/pt-BR/system76_keyboard_configurator_widgets.ftl",
"chars": 280,
"preview": "button-color = Cor\nbutton-cancel = Cancelar\nbutton-save = Salvar\n\nchoose-color = Definir Cor\n\nerror-set-color = Falha ao"
},
{
"path": "i18n/ru/system76_keyboard_configurator.ftl",
"chars": 3490,
"preview": "-name = Конфигуратор клавиатуры\n\napp-about = О программе {-name}\napp-title = {-name} System76\n\nboard-fake = {$model}, по"
},
{
"path": "i18n/ru/system76_keyboard_configurator_backend.ftl",
"chars": 598,
"preview": "mode-disabled = Нет\nmode-solid-color = Сплошной цвет, послойно\nmode-per-key = Сплошной цвет, поклавишно\nmode-active-keys"
},
{
"path": "i18n/ru/system76_keyboard_configurator_widgets.ftl",
"chars": 300,
"preview": "button-color = Цвет\nbutton-cancel = Отменить\nbutton-save = Сохранить\n\nchoose-color = Выберите цвет\n\nerror-set-color = Не"
},
{
"path": "i18n/sl/system76_keyboard_configurator.ftl",
"chars": 3072,
"preview": "-name = Keyboard Configurator\n\napp-about = O {-name}\napp-title = System76 {-name}\n\nboard-fake = {$model}, lažen\n\nbutton-"
},
{
"path": "i18n/sl/system76_keyboard_configurator_backend.ftl",
"chars": 562,
"preview": "mode-disabled = Izklopljeno\nmode-solid-color = Na plast enobarvna\nmode-per-key = Na tipko trdno\nmode-active-keys = Samo "
},
{
"path": "i18n/sl/system76_keyboard_configurator_widgets.ftl",
"chars": 296,
"preview": "button-color = Barva\nbutton-cancel = Prekliči\nbutton-save = Shrani\n\nchoose-color = Nastavi barvo\n\nerror-set-color = Ni u"
},
{
"path": "i18n/tr/system76_keyboard_configurator.ftl",
"chars": 2980,
"preview": "-name = Klavye Yapılandırıcısı\n\napp-about = {-name} Hakkında\napp-title = System76 {-name}\n\nboard-fake = {$model}, sahte\n"
},
{
"path": "i18n/tr/system76_keyboard_configurator_backend.ftl",
"chars": 566,
"preview": "mode-disabled = Etkisizleştirilmiş\nmode-solid-color = Katman Başına Tek Parça Renk\nmode-per-key = Tuş Başına Tek Parça\nm"
},
{
"path": "i18n/tr/system76_keyboard_configurator_widgets.ftl",
"chars": 258,
"preview": "button-color = Renk\nbutton-cancel = İptal\nbutton-save = Kaydet\n\nchoose-color = Rengi Ata\n\nerror-set-color = Klavye rengi"
},
{
"path": "i18n.toml",
"chars": 55,
"preview": "fallback_language = \"en\"\n\n[fluent]\nassets_dir = \"i18n\"\n"
},
{
"path": "layouts/README.md",
"chars": 1230,
"preview": "`picker.json` defines the groups of keycodes that appear in the keycode picker. The labels here are used both in the pic"
},
{
"path": "layouts/keyboards/system76/14in_81/layout.json",
"chars": 2387,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 9,\n 7\n ],\n \"K02\": [\n 8,\n 6\n ],\n \"K03\": [\n 8,\n 7\n ],\n "
},
{
"path": "layouts/keyboards/system76/14in_81/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/14in_81/physical.json",
"chars": 3303,
"preview": "[\n {\n \"name\": \"System76 Lemur Pro - 81 Key\",\n \"author\": \"Levi Portenier\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/14in_83/layout.json",
"chars": 2447,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 8,\n 7\n ],\n \"K02\": [\n 8,\n 6\n ],\n \"K03\": [\n 9,\n 7\n ],\n "
},
{
"path": "layouts/keyboards/system76/14in_83/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/14in_83/physical.json",
"chars": 3457,
"preview": "[\n {\n \"name\": \"System76 Lemur Pro - Simple\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/14in_86/layout.json",
"chars": 2537,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 8,\n 7\n ],\n \"K02\": [\n 8,\n 6\n ],\n \"K03\": [\n 9,\n 7\n ],\n "
},
{
"path": "layouts/keyboards/system76/14in_86/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/14in_86/physical.json",
"chars": 3327,
"preview": "[\n {\n \"name\": \"System76 Galago Pro (galp4)\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n"
},
{
"path": "layouts/keyboards/system76/15in_102/layout.json",
"chars": 3018,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 8,\n 7\n ],\n \"K02\": [\n 9,\n 3\n ],\n \"K03\": [\n 12,\n 5\n ],\n "
},
{
"path": "layouts/keyboards/system76/15in_102/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/15in_102/physical.json",
"chars": 5375,
"preview": "[\n {\n \"name\": \"System76 Darter Pro - Simple\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/15in_102_nkey/layout.json",
"chars": 2989,
"preview": "{\n \"K00\": [\n 6,\n 0\n ],\n \"K01\": [\n 12,\n 0\n ],\n \"K02\": [\n 1,\n 1\n ],\n \"K03\": [\n 7,\n 1\n ],\n "
},
{
"path": "layouts/keyboards/system76/15in_102_nkey/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/15in_102_nkey/physical.json",
"chars": 5375,
"preview": "[\n {\n \"name\": \"System76 Darter Pro - Simple\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/18H9LHA04/layout.json",
"chars": 3018,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 8,\n 7\n ],\n \"K02\": [\n 9,\n 3\n ],\n \"K03\": [\n 12,\n 5\n ],\n "
},
{
"path": "layouts/keyboards/system76/18H9LHA04/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/18H9LHA04/physical.json",
"chars": 5375,
"preview": "[\n {\n \"name\": \"System76 Darter Pro - Simple\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/18H9LHA05/layout.json",
"chars": 3018,
"preview": "{\n \"K00\": [\n 7,\n 7\n ],\n \"K01\": [\n 8,\n 7\n ],\n \"K02\": [\n 9,\n 3\n ],\n \"K03\": [\n 12,\n 5\n ],\n "
},
{
"path": "layouts/keyboards/system76/18H9LHA05/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/18H9LHA05/physical.json",
"chars": 5375,
"preview": "[\n {\n \"name\": \"System76 Darter Pro - Simple\",\n \"author\": \"Jeremy Soller\"\n },\n [\n {\n \"c\": \"#141414\",\n "
},
{
"path": "layouts/keyboards/system76/launch_1/layout.json",
"chars": 2463,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_1/leds.json",
"chars": 1925,
"preview": "{\n \"K00\": [\n 69\n ],\n \"K01\": [\n 70\n ],\n \"K02\": [\n 71\n ],\n \"K03\": [\n 72\n ],\n \"K04\": [\n 73\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_1/physical.json",
"chars": 2300,
"preview": "[\n {\n \"name\": \"System76 Launch Configurable Keyboard 1.0\",\n \"author\": \"Jeremy Soller\",\n \"switchMount\": \"cherry"
},
{
"path": "layouts/keyboards/system76/launch_2/layout.json",
"chars": 2463,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_2/leds.json",
"chars": 1925,
"preview": "{\n \"K00\": [\n 69\n ],\n \"K01\": [\n 70\n ],\n \"K02\": [\n 71\n ],\n \"K03\": [\n 72\n ],\n \"K04\": [\n 73\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_2/physical.json",
"chars": 2300,
"preview": "[\n {\n \"name\": \"System76 Launch Configurable Keyboard 1.0\",\n \"author\": \"Jeremy Soller\",\n \"switchMount\": \"cherry"
},
{
"path": "layouts/keyboards/system76/launch_3/layout.json",
"chars": 2463,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_3/leds.json",
"chars": 1925,
"preview": "{\n \"K00\": [\n 69\n ],\n \"K01\": [\n 70\n ],\n \"K02\": [\n 71\n ],\n \"K03\": [\n 72\n ],\n \"K04\": [\n 73\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_3/physical.json",
"chars": 2300,
"preview": "[\n {\n \"name\": \"System76 Launch Configurable Keyboard 1.0\",\n \"author\": \"Jeremy Soller\",\n \"switchMount\": \"cherry"
},
{
"path": "layouts/keyboards/system76/launch_alpha_1/layout.json",
"chars": 2344,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_alpha_1/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/launch_alpha_1/physical.json",
"chars": 2111,
"preview": "[\n {\n \"name\": \"System76 Launch Configurable Keyboard Alpha 1\",\n \"author\": \"Jeremy Soller\",\n \"switchMount\": \"ch"
},
{
"path": "layouts/keyboards/system76/launch_alpha_2/layout.json",
"chars": 2464,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_alpha_2/leds.json",
"chars": 3,
"preview": "{}\n"
},
{
"path": "layouts/keyboards/system76/launch_alpha_2/physical.json",
"chars": 2305,
"preview": "[\n {\n \"name\": \"System76 Launch Configurable Keyboard Alpha 2\",\n \"author\": \"Jeremy Soller\",\n \"switchMount\": \"ch"
},
{
"path": "layouts/keyboards/system76/launch_heavy_1/layout.json",
"chars": 3084,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_heavy_1/leds.json",
"chars": 2413,
"preview": "{\n \"K00\": [\n 69\n ],\n \"K01\": [\n 70\n ],\n \"K02\": [\n 71\n ],\n \"K03\": [\n 72\n ],\n \"K04\": [\n 73\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_heavy_1/physical.json",
"chars": 3183,
"preview": "[\n {\n \"backcolor\": \"#373737\",\n \"name\": \"Launch Heavy\",\n \"author\": \"Levi\",\n \"radii\": \"24px\"\n },\n [\n {\n "
},
{
"path": "layouts/keyboards/system76/launch_heavy_3/layout.json",
"chars": 3084,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_heavy_3/leds.json",
"chars": 2413,
"preview": "{\n \"K00\": [\n 69\n ],\n \"K01\": [\n 70\n ],\n \"K02\": [\n 71\n ],\n \"K03\": [\n 72\n ],\n \"K04\": [\n 73\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_heavy_3/physical.json",
"chars": 3183,
"preview": "[\n {\n \"backcolor\": \"#373737\",\n \"name\": \"Launch Heavy\",\n \"author\": \"Levi\",\n \"radii\": \"24px\"\n },\n [\n {\n "
},
{
"path": "layouts/keyboards/system76/launch_lite_1/layout.json",
"chars": 2053,
"preview": "{\n \"K00\": [\n 0,\n 0\n ],\n \"K01\": [\n 0,\n 1\n ],\n \"K02\": [\n 0,\n 2\n ],\n \"K03\": [\n 0,\n 3\n ],\n "
},
{
"path": "layouts/keyboards/system76/launch_lite_1/leds.json",
"chars": 1603,
"preview": "{\n \"K00\": [\n 68\n ],\n \"K01\": [\n 67\n ],\n \"K02\": [\n 66\n ],\n \"K03\": [\n 65\n ],\n \"K04\": [\n 64\n ],\n \""
},
{
"path": "layouts/keyboards/system76/launch_lite_1/physical.json",
"chars": 2208,
"preview": "[\n {\n \"backcolor\": \"#373737\",\n \"name\": \"Launch Lite\",\n \"author\": \"Levi\",\n \"radii\": \"24px\"\n },\n [\n {\n "
},
{
"path": "layouts/keymap/ec.json",
"chars": 2009,
"preview": "{\n \"NONE\": 0,\n \"FN\": 4096,\n \"DISPLAY_MODE\": 8192,\n \"PRINT_SCREEN\": 8193,\n \"PAUSE\": 8194,\n \"DISPLAY_TOGGLE\": 16395,"
},
{
"path": "layouts/keymap/qmk.json",
"chars": 15164,
"preview": "{\n \"NONE\": 0,\n \"ROLL_OVER\": 1,\n \"A\": 4,\n \"B\": 5,\n \"C\": 6,\n \"D\": 7,\n \"E\": 8,\n \"F\": 9,\n \"G\": 10,\n \"H\": 11,\n \"I\""
},
{
"path": "layouts/keymap/qmk_legacy.json",
"chars": 4815,
"preview": "{\n \"NONE\": 0,\n \"ROLL_OVER\": 1,\n \"POST_FAIL\": 2,\n \"UNDEFINED\": 3,\n \"A\": 4,\n \"B\": 5,\n \"C\": 6,\n \"D\": 7,\n \"E\": 8,\n "
},
{
"path": "layouts/picker.json",
"chars": 10828,
"preview": "[\n {\n \"label\": \"Alphabet keys\",\n \"cols\": 9,\n \"width\": 1,\n \"keys\": [\n {\n \"keysym\": \"A\",\n "
},
{
"path": "layouts/system76/addw1/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/addw1\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/addw1/meta.json",
"chars": 145,
"preview": "{\n \"display_name\": \"Adder WS\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboard"
},
{
"path": "layouts/system76/addw2/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/addw2\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/addw2/meta.json",
"chars": 145,
"preview": "{\n \"display_name\": \"Adder WS\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboard"
},
{
"path": "layouts/system76/addw3/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/addw3\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/addw3/meta.json",
"chars": 145,
"preview": "{\n \"display_name\": \"Adder WS\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboard"
},
{
"path": "layouts/system76/addw4/default.json",
"chars": 5084,
"preview": "{\n \"model\": \"system76/addw4\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/addw4/meta.json",
"chars": 146,
"preview": "{\n \"display_name\": \"Adder WS\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboard"
},
{
"path": "layouts/system76/bonw14/default.json",
"chars": 5091,
"preview": "{\n \"model\": \"system76/bonw14\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/bonw14/meta.json",
"chars": 153,
"preview": "{\n \"display_name\": \"Bonobo WS\",\n \"has_brightness\": false,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/bonw15/default.json",
"chars": 5091,
"preview": "{\n \"model\": \"system76/bonw15\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/bonw15/meta.json",
"chars": 148,
"preview": "{\n \"display_name\": \"Bonobo WS\",\n \"has_brightness\": false,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/darp10/default.json",
"chars": 5085,
"preview": "{\n \"model\": \"system76/darp10\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp10/meta.json",
"chars": 149,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/darp10-b/default.json",
"chars": 4094,
"preview": "{\n \"model\": \"system76/darp10-b\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp10-b/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/darp11/default.json",
"chars": 5085,
"preview": "{\n \"model\": \"system76/darp11\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp11/meta.json",
"chars": 149,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/darp11-b/default.json",
"chars": 4094,
"preview": "{\n \"model\": \"system76/darp11-b\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp11-b/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/darp5/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/darp5\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp5/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboa"
},
{
"path": "layouts/system76/darp6/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/darp6\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp6/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboa"
},
{
"path": "layouts/system76/darp7/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/darp7\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp7/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboa"
},
{
"path": "layouts/system76/darp8/default.json",
"chars": 5090,
"preview": "{\n \"model\": \"system76/darp8\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp8/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": true,\n \"pressed_color\": \"#dfdfdf\",\n \"keyboa"
},
{
"path": "layouts/system76/darp9/default.json",
"chars": 5082,
"preview": "{\n \"model\": \"system76/darp9\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/darp9/meta.json",
"chars": 149,
"preview": "{\n \"display_name\": \"Darter Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/galp3-c/default.json",
"chars": 4331,
"preview": "{\n \"model\": \"system76/galp3-c\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/galp3-c/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Galago Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/galp4/default.json",
"chars": 4329,
"preview": "{\n \"model\": \"system76/galp4\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/galp4/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Galago Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
},
{
"path": "layouts/system76/galp5/default.json",
"chars": 4097,
"preview": "{\n \"model\": \"system76/galp5\",\n \"version\": 1,\n \"map\": {\n \"K00\": [\n \"ESC\",\n \"ESC\"\n ],\n \"K01\": [\n "
},
{
"path": "layouts/system76/galp5/meta.json",
"chars": 147,
"preview": "{\n \"display_name\": \"Galago Pro\",\n \"has_brightness\": true,\n \"has_color\": false,\n \"pressed_color\": \"#dfdfdf\",\n \"keybo"
}
]
// ... and 116 more files (download for full content)
About this extraction
This page contains the full source code of the pop-os/keyboard-configurator GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 316 files (1.2 MB), approximately 463.1k tokens, and a symbol index with 642 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.