Skip to content

Commit d868e18

Browse files
committed
checkpoint 5
1 parent 3acc093 commit d868e18

6 files changed

Lines changed: 191 additions & 425 deletions

File tree

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,40 @@ Quality couch keyboards are not so accessible, STT on Linux isn’t in a good st
2525
## Development Setup
2626

2727
> [!NOTE]
28-
> **For Linux:** On Wayland, the `ydotoold` daemon must be running and your user must be part of the `ydotool` group. Additionally, some native dependencies are required : install them via your package manager (see [`shell.nix`](shell.nix) for the list), or use `nix-shell` directly.
29-
28+
> **For Linux**
29+
>
30+
> Rein uses a virtual input device (`/dev/uinput`) for keyboard and mouse injection.
31+
>
32+
> On Wayland, screen capture requires a working PipeWire + XDG Desktop Portal setup (typically provided by your desktop environment).
33+
>
34+
> Your user must also have permission to access `/dev/uinput`. A common setup is:
35+
>
36+
> ```bash
37+
> sudo tee /etc/udev/rules.d/99-rein.rules <<EOF
38+
> KERNEL=="uinput", MODE="0660", GROUP="input"
39+
> EOF
40+
>
41+
> sudo usermod -aG input $USER
42+
>
43+
> sudo udevadm control --reload-rules
44+
> sudo udevadm trigger
45+
> ```
46+
>
47+
> Log out and back in after running the commands above.
48+
>
49+
> You can verify access with:
50+
>
51+
> ```bash
52+
> ls -l /dev/uinput
53+
> ```
54+
>
55+
> which should show:
56+
>
57+
> ```text
58+
> crw-rw---- 1 root input ... /dev/uinput
59+
> ```
60+
>
61+
> Additionally, some native dependencies are required. Install them via your package manager (see [`shell.nix`](shell.nix) for the list), or use `nix-shell` directly.
3062
3163
### Quick Start
3264

src/hooks/useCaptureProvider.ts

Lines changed: 0 additions & 159 deletions
This file was deleted.

src/hooks/useMirrorStream.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/routes/__root.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ConnectionProvider,
1313
useConnection,
1414
} from "../contexts/ConnectionProvider"
15-
import { useCaptureProvider } from "../hooks/useCaptureProvider"
1615

1716
export const Route = createRootRoute({
1817
component: AppWithConnection,
@@ -37,34 +36,12 @@ function AppWithConnection() {
3736
function RootComponent() {
3837
return (
3938
<RootDocument>
40-
<DesktopCaptureProvider />
4139
<Outlet />
4240
{/* <TanStackRouterDevtools position="bottom-right" /> */}
4341
</RootDocument>
4442
)
4543
}
4644

47-
function DesktopCaptureProvider() {
48-
const { wsRef, status } = useConnection()
49-
const { startSharing } = useCaptureProvider(wsRef)
50-
const hasStartedRef = useRef(false)
51-
52-
useEffect(() => {
53-
if (status !== "connected" || hasStartedRef.current) return
54-
55-
// Mobile detection: avoid auto-start on mobile
56-
const isMobile = /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)
57-
const canShare = !!navigator.mediaDevices?.getDisplayMedia
58-
59-
if (!isMobile && canShare) {
60-
hasStartedRef.current = true
61-
startSharing()
62-
}
63-
}, [status, startSharing])
64-
65-
return null
66-
}
67-
6845
function ThemeInit() {
6946
useEffect(() => {
7047
if (typeof localStorage === "undefined") return

0 commit comments

Comments
 (0)