Skip to content

pranavkarthik10/miru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miru

miru is still pretty experimental. It works, but you should expect rough edges, occasional bugs, and behavior that may vary across setups.

miru is an open-source Rust CLI that switches monitor focus based on head direction.

It runs locally on your machine. Webcam input, calibration, tracking, and focus changes all stay on-device. The release build is meant to feel like a single CLI: models and the ONNX Runtime DLL are embedded and extracted automatically on first run.

What It Does

  • Calibrates your head position against the monitors you want to use
  • Tracks head direction from a webcam
  • Switches focus to the prominent window between calibrated monitors as you look across them
  • Works best on horizontal multi-monitor setups
  • Prioritizes Windows first, with room to expand later

Why

miru lets you have focused work sessions where you can easily swap between work on different monitors without having to lift your hands off of your keyboard.

Install

Download A Release Binary

Download the latest Windows release from GitHub Releases, unzip it, and run:

.\miru.exe

By default, miru recalibrates on launch. If you want to reuse the last saved calibration instead:

.\miru.exe --reuse-calibration

If the folder containing miru.exe is on your PATH, you can also run:

miru
miru --reuse-calibration

Build From Source

cargo build --release
.\target\release\miru.exe

Quick Start

  1. Run miru
  2. Follow the prompts to calibrate the monitors you want to use
  3. Use miru --reuse-calibration if you want to skip calibration on later launches
  4. Turn your head to move focus between monitors

Usage

Common options:

--reuse-calibration
--calibration-file PATH
--camera N
--verbose
--switch-cooldown-ms N
--switch-threshold-deg F
--focus-mode move-and-focus|move-and-click|move-only

Defaults:

  • --camera: 0
  • --switch-cooldown-ms: 200
  • --switch-threshold-deg: 1.5
  • --focus-mode: move-and-focus

Run miru --help to see the full CLI help.

Calibration

During calibration, miru walks through the detected monitors one by one.

  • Press Enter to calibrate the shown monitor
  • Type s and press Enter to skip a monitor you do not want to use

Only calibrated monitors are used for switching, so you can leave out any display you do not want in the rotation.

Focus Modes

miru supports three focus modes:

  • move-and-focus: move the pointer and try native window focus
  • move-and-click: move the pointer and allow click-based focus transfer
  • move-only: move the pointer without trying to focus anything

If you want pointer movement without focus transfer, use:

.\miru.exe --focus-mode move-only

Configuration

Calibration is stored in the local app data directory:

%LocalAppData%\miru\calibration.json

If you want to keep calibration somewhere else, use --calibration-file.

Embedded runtime assets are extracted on demand to:

%LocalAppData%\miru\models\
%LocalAppData%\miru\runtime\

FAQ

Does it use eye tracking?

No. It uses face detection plus facial landmarks to estimate head direction. The goal is stable monitor switching, not precise gaze tracking.

Is it real-time?

It is near-real-time, but not instant. The current implementation is tuned to stay usable on CPU while avoiding accidental switching.

Will it work with more than two monitors?

Often, yes, especially for horizontal layouts. Vertical or irregular layouts may need more tuning because pitch separation is weaker than yaw.

How do I use only some of my monitors?

Skip the monitors you do not want during calibration. Only calibrated monitors are used afterward.

Why do I see names like \\.\DISPLAY1?

Those are Windows display device identifiers. miru uses them internally, but the CLI also tries to present friendlier labels when possible.

Credits

Bundled model credits:

  • UltraFace RFB-320 face detector
  • 68-point facial landmark model used for head-direction estimation

About

Rust CLI for monitor focus switching from head pose

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages