Skip to content

Commit

Permalink
Add support Time and Input layout for MacOS (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: vadimsuhanov <vadim.sukhanov@tele2.ru>
  • Loading branch information
suhanovv and vadimsuhanov authored Sep 18, 2024
1 parent b79e976 commit bef1bb6
Show file tree
Hide file tree
Showing 10 changed files with 323 additions and 16 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,34 @@ jobs:
path: dist
name: ubuntu

build-macos:
name: '[Macos] Build and Publish'
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Build
run: cargo build --release

- name: Install cargo-make
uses: davidB/rust-cargo-make@v1

- name: Publish files
run: cargo make dist

- name: Upload files
uses: actions/upload-artifact@v4
with:
path: dist
name: macos

pre-release:
name: Pre-Release
needs:
- build-windows
- build-ubuntu
- build-macos
runs-on: ubuntu-latest
permissions:
contents: 'write'
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ jobs:

- name: Run tests
run: cargo test

build-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Build
run: cargo build --release

- name: Run tests
run: cargo test
141 changes: 135 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tracing = "0.1"
tracing-subscriber = { version="0.3", features = ["env-filter"] }
chrono = "0.4.26"
hidapi = "2.4.0"
tokio = { version = "1.29.1", features = ["sync"] }
tokio = { version = "1.29.1", features = ["full"] }
async-std = "1.7.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -26,6 +26,11 @@ libpulse-binding = "2.28.1"
x11 = "2.21.0"
mpris = "2.0.1"

[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.10"
core-foundation-sys = "0.8.7"
libc = "0.2"

[target.'cfg(target_os = "windows")'.dependencies]
[dependencies.windows]
version = "0.56"
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Application is written in Rust which gives easy access to HID libraries, low-lev

## Supported platforms/providers

| | Windows | Linux |
| ------------ | ------------------ | ------------------------------- |
| Time | :heavy_check_mark: | :heavy_check_mark: |
| Volume | :heavy_check_mark: | :heavy_check_mark: (PulseAudio) |
| Input layout | :heavy_check_mark: | :heavy_check_mark: (X11) |
| Media info | :heavy_check_mark: | :heavy_check_mark: (D-Bus) |
| | Windows | Linux | macos |
| ------------ | ------------------ | ------------------------------- |--------------------|
| Time | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Volume | :heavy_check_mark: | :heavy_check_mark: (PulseAudio) | |
| Input layout | :heavy_check_mark: | :heavy_check_mark: (X11) | :heavy_check_mark: |
| Media info | :heavy_check_mark: | :heavy_check_mark: (D-Bus) | |

MacOS is not supported, as I don't own any Apple devices, feel free to raise PRs.
MacOS is partially supported, as I don't own any Apple devices, feel free to raise PRs.

## How to run it

Expand Down Expand Up @@ -57,14 +57,16 @@ When you verified that the application works with your keyboard, you can use `qm
2. Reconnect keyboard
3. Start `qmk-hid-host`, add it to autorun if needed

### MacOS
1. Start `qmk-hid-host`, add it to autorun if needed

## Development

1. Install Rust
2. Run `cargo run`
3. If needed, edit `qmk-hid-host.json` in root folder and run again

## Changelog

- 2024-02-06 - add Linux support
- 2024-01-21 - remove run as windows service, add silent version instead
- 2024-01-02 - support RUST_LOG, run as windows service
Expand Down
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ fn main() {

#[cfg(target_os = "windows")]
fn main() {}

#[cfg(target_os = "macos")]
fn main() {}
Loading

0 comments on commit bef1bb6

Please sign in to comment.