thales is a tiny tool that reacts to monitor updates in Hyprland.
Instead of cloning displays or manually toggling configs, you can define per monitor rules in a simple TOML file.
When a monitor connects or disconnects, thales runs the monitor config you’ve set for example, disabling your laptop screen when an external monitor is plugged in.
From Source
git clone https://github.com/vincbro/thales.git
cd thales
cargo build --releaseThen add this to your Hyprland config:
exec-once = PATH/TO/thales/target/release/thales
Thales uses a single TOML config found at ~/.config/thales/config.json.
Here’s an example (my personal setup):
[[monitors]]
name = "HDMI-A-1"
on_added = ["eDP-1,disabled"]
on_removed = ["ePD-1,1920x1080@60,0x0,1"]- When
HDMI-A-1gets plugged in, it runs theon_addedcommand -> disableseDP-1. - On startup or config reload,
thaleschecks all monitors listed in your config.- If a monitor is connected, it runs
on_added. - If not, it runs
on_removed.
- If a monitor is connected, it runs
The commands use Hyprland’s built in monitor syntax. -> Read more here.