Setup
Choose your preferred setup approach based on whether you want to run the daemon for automatic profile switching.
Understanding HDM flow
In essence, what hyprdynamicmonitors does is:
- Aggregate all system information about battery/lid states (optional)
- Aggregate information from Hyprland about the currently connected outputs (think:
hyprctl monitors all) - See what the user defined in
config.toml- Iterate through user-defined profiles and find the best matching one
- For that profile, see what template or static configuration it requires
- Render that configuration to the
config.general.destinationlocation
This is a simplified view, but it gives you a good understanding of the system. In reality, it responds to events, aggregates state on startup, sends notifications, and may execute callbacks. See Configuration for more details.
Choose Your Approach
For detailed information about running with or without power events, see the power events guide.
When running the daemon with power (default) or lid events enabled, ensure that UPower is installed and its service is running.
Option A: TUI + Daemon (Recommended for Most Users)
Best for: Users who want automatic profile switching and an easy visual setup.
The TUI (Terminal User Interface) provides a visual way to configure monitors and automatically creates the daemon configuration for you.
-
Launch the TUI (this automatically creates a default configuration):
hyprdynamicmonitors tui -
Configure your monitors in the Monitors view:
- Use arrow keys to select a monitor
- Press
Enterto edit it - Adjust position, resolution, scale, etc.
- Press
Ato apply and test the configuration
-
Save as a profile by switching to the Profile view:
- Press
Tabto switch to HDM Profile view - Press
nto create a new profile - Enter a profile name (e.g., "laptop-only")
- The profile is automatically saved to your configuration
- Press
-
Source the configuration in your
~/.config/hypr/hyprland.conf:source = ~/.config/hypr/monitors.conf -
Run the daemon for automatic profile switching:
# Add to ~/.config/hypr/hyprland.conf
exec-once = hyprdynamicmonitors run
# Or use systemd
systemctl --user daemon-reload
systemctl --user enable --now hyprdynamicmonitors.service -
Set up the prepare command to prevent startup issues:
tipThe
preparecommand removes disabled monitor entries from your configuration before Hyprland starts, preventing the "no active displays" issue. See What is hyprdynamicmonitors prepare? for details.If using systemd (recommended):
systemctl --user enable hyprdynamicmonitors-prepare.serviceIf running Hyprland manually (e.g., from TTY with
Hyprlandcommand):# Add to your shell alias or startup script
hyprdynamicmonitors prepare && HyprlandSee the prepare documentation for more setup options.
Systemd services are recommended in favor of exec-once: see Running with systemd.
What happens: The daemon monitors for display and power changes, automatically switching between your saved profiles.
Option B: Manual Configuration + Daemon
Best for: Users who prefer manual configuration file editing.
-
Create the configuration file at
~/.config/hyprdynamicmonitors/config.toml:[general]
destination = "$HOME/.config/hypr/monitors.conf"
[power_events]
[power_events.dbus_query_object]
path = "/org/freedesktop/UPower/devices/line_power_ACAD"
[[power_events.dbus_signal_match_rules]]
object_path = "/org/freedesktop/UPower/devices/line_power_ACAD"
[profiles.laptop_only]
config_file = "hyprconfigs/laptop.conf"
config_file_type = "static"
[[profiles.laptop_only.conditions.required_monitors]]
name = "eDP-1" # Replace with your display name from hyprctl monitors -
Create the monitor configuration at
~/.config/hyprdynamicmonitors/hyprconfigs/laptop.conf:monitor=eDP-1,2880x1920@120.00000,0x0,2.0,vrr,1Replace with your actual monitor settings (check
hyprctl monitors). -
Source the configuration in your
~/.config/hypr/hyprland.conf:source = ~/.config/hypr/monitors.conf -
Run the daemon:
# Add to ~/.config/hypr/hyprland.conf
exec-once = hyprdynamicmonitors run -
Set up the prepare command to prevent startup issues:
tipThe
preparecommand removes disabled monitor entries from your configuration before Hyprland starts, preventing the "no active displays" issue. See What is hyprdynamicmonitors prepare? for details.If using systemd (recommended):
systemctl --user enable hyprdynamicmonitors-prepare.serviceIf running Hyprland manually (e.g., from TTY with
Hyprlandcommand):# Add to your shell alias or startup script
hyprdynamicmonitors prepare && HyprlandSee the prepare documentation for more setup options.
Or use systemd (recommended for production), instead of exec-once: see Running with systemd.
Option C: TUI Only (No Daemon)
Best for: Desktop users with stable monitor setups who prefer manual control.
-
Launch the TUI:
hyprdynamicmonitors tui -
Configure and save profiles in the TUI:
- Adjust monitors in the Monitors view
- Press
Ato test changes ephemerally (optional) - Switch to the Profile view with
Tab - Press
nto create a new profile orato update an existing one - Press
Rto manually render the configuration to the destination file
-
Source the configuration in your
~/.config/hypr/hyprland.conf:source = ~/.config/hypr/monitors.conf -
Set up the prepare command to prevent startup issues:
tipThe
preparecommand removes disabled monitor entries from your configuration before Hyprland starts, preventing the "no active displays" issue. See What is hyprdynamicmonitors prepare? for details.If using systemd:
systemctl --user enable hyprdynamicmonitors-prepare.serviceIf running Hyprland manually (e.g., from TTY with
Hyprlandcommand):# Add to your shell alias or startup script
hyprdynamicmonitors prepare && HyprlandSee the prepare documentation for more setup options.
Without the daemon, you manage profile rendering manually using the R key in the Profile view. See the Running without a daemon guide for detailed workflows.
Validation and Testing
Before running the daemon, validate your configuration:
# Validate configuration file
hyprdynamicmonitors validate
# Test what would happen without making changes
hyprdynamicmonitors run --dry-run
# Run once and exit (for testing)
hyprdynamicmonitors run --run-once
Next Steps
- Learn about CLI Commands for validation and testing
- Explore Profiles for power state and multi-monitor setups
- Check out Templates for dynamic configurations
- See Examples for advanced configurations
- Read the TUI Guide for detailed TUI usage