mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-17 01:51:28 +03:00
Compare commits
1 Commits
0d96948c26
...
macos-fix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c69d4d209 |
4
.github/workflows/cachix.yml
vendored
4
.github/workflows/cachix.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-15-intel
|
- macos-13
|
||||||
- macos-14
|
- macos-14
|
||||||
name: "Build"
|
name: "Build"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
run: nix build --print-build-logs --show-trace .#packages.x86_64-linux.lan-mouse
|
run: nix build --print-build-logs --show-trace .#packages.x86_64-linux.lan-mouse
|
||||||
|
|
||||||
- name: Build lan-mouse (x86_64-darwin)
|
- name: Build lan-mouse (x86_64-darwin)
|
||||||
if: matrix.os == 'macos-15-intel'
|
if: matrix.os == 'macos-13'
|
||||||
run: nix build --print-build-logs --show-trace .#packages.x86_64-darwin.lan-mouse
|
run: nix build --print-build-logs --show-trace .#packages.x86_64-darwin.lan-mouse
|
||||||
|
|
||||||
- name: Build lan-mouse (aarch64-darwin)
|
- name: Build lan-mouse (aarch64-darwin)
|
||||||
|
|||||||
2
.github/workflows/pre-release.yml
vendored
2
.github/workflows/pre-release.yml
vendored
@@ -80,7 +80,7 @@ jobs:
|
|||||||
path: lan-mouse-windows.zip
|
path: lan-mouse-windows.zip
|
||||||
|
|
||||||
macos-release-build:
|
macos-release-build:
|
||||||
runs-on: macos-15-intel
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
|
|||||||
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@@ -94,7 +94,7 @@ jobs:
|
|||||||
target/debug/*.dll
|
target/debug/*.dll
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-15-intel
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
|
|||||||
2
.github/workflows/tagged-release.yml
vendored
2
.github/workflows/tagged-release.yml
vendored
@@ -76,7 +76,7 @@ jobs:
|
|||||||
path: lan-mouse-windows.zip
|
path: lan-mouse-windows.zip
|
||||||
|
|
||||||
macos-release-build:
|
macos-release-build:
|
||||||
runs-on: macos-15-intel
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
|
|||||||
@@ -453,10 +453,8 @@ fn create_event_tap<'a>(
|
|||||||
// Returning Drop should stop the event from being processed
|
// Returning Drop should stop the event from being processed
|
||||||
// but core fundation still returns the event
|
// but core fundation still returns the event
|
||||||
cg_ev.set_type(CGEventType::Null);
|
cg_ev.set_type(CGEventType::Null);
|
||||||
CallbackResult::Drop
|
|
||||||
} else {
|
|
||||||
CallbackResult::Keep
|
|
||||||
}
|
}
|
||||||
|
CallbackResult::Replace(cg_ev.to_owned())
|
||||||
};
|
};
|
||||||
|
|
||||||
let tap = CGEventTap::new(
|
let tap = CGEventTap::new(
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# Nix Flake Usage
|
# Nix Flake Usage
|
||||||
|
|
||||||
## Run
|
## run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix run github:feschber/lan-mouse
|
nix run github:feschber/lan-mouse
|
||||||
|
|
||||||
# With params
|
# with params
|
||||||
nix run github:feschber/lan-mouse -- --help
|
nix run github:feschber/lan-mouse -- --help
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Home-manager module
|
## home-manager module
|
||||||
|
|
||||||
Add input:
|
add input
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
inputs = {
|
inputs = {
|
||||||
@@ -20,27 +20,14 @@ inputs = {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Optional: add [our binary cache](https://app.cachix.org/cache/lan-mouse) to allow a faster package install.
|
enable lan-mouse
|
||||||
|
|
||||||
```nix
|
|
||||||
nixConfig = {
|
|
||||||
extra-substituters = [
|
|
||||||
"https://lan-mouse.cachix.org/"
|
|
||||||
];
|
|
||||||
extra-trusted-public-keys = [
|
|
||||||
"lan-mouse.cachix.org-1:KlE2AEZUgkzNKM7BIzMQo8w9yJYqUpor1CAUNRY6OyM="
|
|
||||||
];
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable lan-mouse:
|
|
||||||
|
|
||||||
``` nix
|
``` nix
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# Add the Home Manager module
|
# add the home manager module
|
||||||
imports = [inputs.lan-mouse.homeManagerModules.default];
|
imports = [inputs.lan-mouse.homeManagerModules.default];
|
||||||
|
|
||||||
programs.lan-mouse = {
|
programs.lan-mouse = {
|
||||||
|
|||||||
@@ -362,13 +362,7 @@ impl CaptureTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn release_capture(&mut self, capture: &mut InputCapture) -> Result<(), CaptureError> {
|
async fn release_capture(&mut self, capture: &mut InputCapture) -> Result<(), CaptureError> {
|
||||||
// If we have an active client, notify them we're leaving
|
self.active_client.take();
|
||||||
if let Some(handle) = self.active_client.take() {
|
|
||||||
log::info!("sending Leave event to client {handle}");
|
|
||||||
if let Err(e) = self.conn.send(ProtoEvent::Leave(0), handle).await {
|
|
||||||
log::warn!("failed to send Leave to client {handle}: {e}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
capture.release().await
|
capture.release().await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,18 +223,14 @@ async fn ping_pong(
|
|||||||
) {
|
) {
|
||||||
loop {
|
loop {
|
||||||
let (buf, len) = ProtoEvent::Ping.into();
|
let (buf, len) = ProtoEvent::Ping.into();
|
||||||
|
if let Err(e) = conn.send(&buf[..len]).await {
|
||||||
// send 4 pings, at least one must be answered
|
log::warn!("{addr}: send error `{e}`, closing connection");
|
||||||
for _ in 0..4 {
|
let _ = conn.close().await;
|
||||||
if let Err(e) = conn.send(&buf[..len]).await {
|
break;
|
||||||
log::warn!("{addr}: send error `{e}`, closing connection");
|
|
||||||
let _ = conn.close().await;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
log::trace!("PING >->->->->- {addr}");
|
|
||||||
|
|
||||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
|
||||||
}
|
}
|
||||||
|
log::trace!("PING >->->->->- {addr}");
|
||||||
|
|
||||||
|
tokio::time::sleep(Duration::from_millis(500)).await;
|
||||||
|
|
||||||
if !ping_response.borrow_mut().remove(&addr) {
|
if !ping_response.borrow_mut().remove(&addr) {
|
||||||
log::warn!("{addr} did not respond, closing connection");
|
log::warn!("{addr} did not respond, closing connection");
|
||||||
|
|||||||
Reference in New Issue
Block a user