### Setup Development Environment Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Installs all necessary dependencies for development, including Go toolchain, Python virtual environment, Node.js dependencies, and pre-commit hooks. ```bash make dev ``` -------------------------------- ### Create Initial Template with Freeze Command Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Use the 'freeze' command to capture your current monitor setup as a starting template. This provides a base for customization. ```bash hyprdynamicmonitors freeze --profile-name my-setup ``` -------------------------------- ### Install Project Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Installs the project to a specified directory. Defaults to ~/.local/bin. ```bash make install ``` -------------------------------- ### Imperative Installation with Nix Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md Install HyprDynamicMonitors to your user profile using the `nix profile install` command. ```bash nix profile install github:fiffeek/hyprdynamicmonitors ``` -------------------------------- ### Conditional Actions: Start/Stop Service Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/callbacks.md Use profile-specific post_apply_exec callbacks to conditionally start or stop services based on the activated profile. This example manages a 'docked-setup' service. ```toml [profiles.docked] config_file = "hyprconfigs/docked.conf" post_apply_exec = "systemctl --user start docked-setup.service" [profiles.laptop_only] config_file = "hyprconfigs/laptop.conf" post_apply_exec = "systemctl --user stop docked-setup.service" ``` -------------------------------- ### Custom UPower D-Bus Query Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/power-events.md An example of a custom D-Bus query command to retrieve the 'OnBattery' property. This is provided for reference and is not recommended for production unless you have a custom power management setup. ```bash dbus-send --system --print-reply --dest=org.freedesktop.UPower \ /org/freedesktop/UPower \ org.freedesktop.DBus.Properties.Get \ string:org.freedesktop.UPower string:OnBattery ``` -------------------------------- ### Install Hyprdynamicmonitors via Binary Release Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/installation.md Download and execute the installation script for the latest binary release. Optionally, set the DESTDIR environment variable to change the installation directory. ```bash # optionally override the destination directory, defaults to ~/.local/bin/ export DESTDIR="$HOME/.bin" curl -o- https://raw.githubusercontent.com/fiffeek/hyprdynamicmonitors/refs/heads/main/scripts/install.sh | bash ``` -------------------------------- ### Configure Custom Theme (Manual Installation) Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/theming.md Specify the path to a custom theme file when themes are installed manually. This example points to a theme located in the user's config directory. ```toml [tui.colors] source = "~/.config/hyprdynamicmonitors/themes/my_theme.toml" ``` -------------------------------- ### Using Built-in Theme (Manual Installation) Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/theming.md Reference a built-in theme file after copying it to the user's config directory for manual installations. Changes are detected automatically. ```toml [tui.colors] source = "~/.config/hyprdynamicmonitors/themes/rose-pine.toml" ``` -------------------------------- ### Build and Install Hyprdynamicmonitors from Source Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/installation.md Build the Hyprdynamicmonitors binary using 'make'. The output is placed in './dest/'. You can install it to a custom location or system-wide, and also uninstall it. ```bash # Build the binary (output goes to ./dest/) make ``` ```bash # Install to custom location make DESTDIR=$HOME/binaries install ``` ```bash # Uninstall from custom location make DESTDIR=$HOME/binaries uninstall ``` ```bash # Install system-wide (may require sudo) sudo make DESTDIR=/usr/bin install ``` -------------------------------- ### Enable and Start UPower Service Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Enable the UPower service to start on boot and start it immediately. This ensures power events are active. ```bash sudo systemctl enable --now upower ``` -------------------------------- ### Start and Enable HyprDynamicMonitors Systemd User Services Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/systemd.md Start the HyprDynamicMonitors daemon service and enable both the daemon and prepare services to start automatically on boot. The prepare service typically runs before Hyprland starts. ```bash systemctl --user start hyprdynamicmonitors.service systemctl --user enable --now hyprdynamicmonitors.service systemctl --user enable hyprdynamicmonitors-prepare.service ``` -------------------------------- ### Different Layouts Based on Lid State Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/lid-events.md This Go template example configures different monitor layouts based on whether the lid is closed (external monitor only) or open (dual monitor setup). ```go {{if isLidClosed}} # Closed lid: external monitor only monitor=eDP-1,disable monitor=DP-1,3840x2160@60,0x0,1 {{else}} # Open lid: dual monitor setup monitor=eDP-1,2880x1920@120,0x0,2.0 monitor=DP-1,3840x2160@60,2880x0,1 {{end}} ``` -------------------------------- ### Static Configuration Profile Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md Example of a profile using a static configuration file. The service will create a symlink to this file. ```toml [profiles.laptop_only] config_file = "hyprconfigs/laptop.conf" config_file_type = "static" ``` ```hyprland monitor=eDP-1,2880x1920@120,0x0,2.0,vrr,1 ``` -------------------------------- ### Template Configuration Profile Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md Example of a profile using a template configuration file for dynamic generation. It specifies conditions for two types of monitors. ```toml [profiles.dual_monitor] config_file = "hyprconfigs/dual.go.tmpl" config_file_type = "template" [[profiles.dual_monitor.conditions.required_monitors]] name = "eDP-1" monitor_tag = "laptop" [[profiles.dual_monitor.conditions.required_monitors]] description = "LG.*ULTRAWIDE" match_description_using_regex = true monitor_tag = "external" ``` -------------------------------- ### Declarative Home Manager Configuration: Install Package Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md In your `home.nix`, add HyprDynamicMonitors to the user's packages. ```nix { inputs, system, ... }: { home.packages = [ inputs.hyprdynamicmonitors.packages.${system}.default ]; } ``` -------------------------------- ### Example: Reload Hyprland and Restart Waybar After Change Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/callbacks.md Use post_apply_exec to execute commands after configuration is applied, like reloading Hyprland and restarting Waybar. ```toml post_apply_exec = "hyprctl reload && systemctl --user restart waybar" ``` -------------------------------- ### Launch TUI for Testing with Mock Monitors File and Custom Config Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Starts the TUI in testing mode, overriding both the Hyprland monitor specifications and the main configuration file. This allows for comprehensive testing of different setups. ```bash hyprdynamicmonitors tui --hypr-monitors-override /path/to/monitors-spec.txt --config /path/to/config.toml ``` -------------------------------- ### Using Built-in Theme (AUR Installation) Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/theming.md Reference a built-in theme file for AUR installations. Changes are detected automatically. ```toml [tui.colors] source = "/usr/share/hyprdynamicmonitors/themes/static/rose-pine/theme.toml" ``` -------------------------------- ### Template Configuration File Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md A Go template file used for dynamically generating Hyprland monitor configurations based on monitor tags and power state. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} {{- $external := index .MonitorsByTag "external" -}} monitor={{$laptop.Name}},{{if isOnAC}}2880x1920@120{{else}}1920x1080@60{{end}},0x0,2.0 monitor={{$external.Name}},preferred,2880x0,1 ``` -------------------------------- ### Documentation Commands Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Commands for working with documentation. Starts a development server for live preview and generates help documentation or table of contents. ```bash make docs # Start documentation development server ``` ```bash make help/generate # Generate help documentation from binary ``` ```bash make toc/generate # Generate table of contents for markdown files ``` -------------------------------- ### Example: Reload Waybar Before Change Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/callbacks.md Use pre_apply_exec to execute commands before configuration is applied, such as reloading Waybar. ```toml pre_apply_exec = "killall -SIGUSR1 waybar" ``` -------------------------------- ### Example Theme File Structure Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/theming.md An example of the structure for an external TOML theme file, defining various color properties. ```toml # Example theme file active_pane_color = "#7aa2f7" inactive_pane_color = "#565f89" header_color = "#bb9af7" # ... more colors ``` -------------------------------- ### Running the Prepare Command Manually Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Demonstrates how to execute the 'prepare' command directly in the terminal. This is useful for immediate cleanup before manually starting Hyprland. ```bash hyprdynamicmonitors prepare ``` -------------------------------- ### Example Go Template for Monitor Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/tui.md This Go template demonstrates dynamic monitor configuration based on system state. It uses template variables to set different resolutions based on whether the system is on AC power. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} monitor={{$laptop.Name}},{{if isOnAC}}2880x1920@120{{else}}1920x1080@60{{end}},0x0,2.0 ``` -------------------------------- ### Using Prepare Command in a Startup Alias Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Shows how to create a shell alias that first runs the 'prepare' command and then starts Hyprland. This automates the cleanup process when launching Hyprland via the alias. ```bash alias hyprstart="hyprdynamicmonitors prepare && Hyprland" ``` -------------------------------- ### Install Hyprdynamicmonitors from AUR Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/installation.md Install the hyprdynamicmonitors-bin package using an AUR helper like 'yay' or 'paru'. Alternatively, clone the AUR repository and use makepkg. ```bash # Using your preferred AUR helper (replace 'aurHelper' with your choice) aurHelper="yay" # or paru, trizen, etc. $aurHelper -S hyprdynamicmonitors-bin ``` ```bash # Or using makepkg: git clone https://aur.archlinux.org/hyprdynamicmonitors-bin.git cd hyprdynamicmonitors-bin makepkg -si ``` -------------------------------- ### Install UPower on Debian/Ubuntu Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Install the UPower package on Debian or Ubuntu systems. UPower is necessary for hyprdynamicmonitors to manage power events. ```bash sudo apt install upower ``` -------------------------------- ### Launch TUI Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/running-without-daemon.md Starts the Hyprdynamicmonitors Text User Interface for managing monitor configurations. ```bash hyprdynamicmonitors tui ``` -------------------------------- ### Freeze Current Monitor Setup Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Capture your current Hyprland monitor configuration and save it as a new profile template. This command creates a Go template file and adds a new profile entry to your configuration, useful for creating new profiles based on your current setup. ```bash hyprdynamicmonitors freeze --profile-name dual-monitors ``` ```bash hyprdynamicmonitors freeze --profile-name triple-4k \ --config-file-location ~/my-configs/triple.go.tmpl ``` -------------------------------- ### Generic Fallback Monitor Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md An example of a generic fallback configuration that applies preferred settings to all connected monitors. ```shell # Generic fallback: configure all connected monitors with preferred settings monitor=,preferred,auto,1 ``` -------------------------------- ### Example Profile Priority Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/monitor-matching.md Demonstrates how profile priority works when multiple profiles match. The last defined profile with an equal score is selected. ```toml # This profile will be selected for laptop-only setup [profiles.laptop_basic] config_file = "hyprconfigs/laptop-basic.conf" [[profiles.laptop_basic.conditions.required_monitors]] name = "eDP-1" # This profile will be selected instead (defined last) [profiles.laptop_optimized] config_file = "hyprconfigs/laptop-optimized.conf" [[profiles.laptop_optimized.conditions.required_monitors]] name = "eDP-1" ``` -------------------------------- ### Declarative NixOS Configuration: Install Package Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md In your `configuration.nix`, add HyprDynamicMonitors to the system's environment packages. ```nix { inputs, system, ... }: { environment.systemPackages = [ inputs.hyprdynamicmonitors.packages.${system}.default ]; } ``` -------------------------------- ### Reference Monitor by Tag in Go Template Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/monitor-matching.md Access monitors within Go templates using their assigned tags. This example retrieves the monitor tagged 'laptop' and configures it. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} monitor={{$laptop.Name}},preferred,0x0,1 ``` -------------------------------- ### Configuration for Home Setup Modes Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md Defines the destination for generated Hyprland configuration and sets up profiles for different display modes (home) with specific monitor requirements. ```toml # ~/.config/hyprdynamicmonitors/config.toml [general] destination = "$HOME/.config/hypr/config.d/99_autogenerated-monitors.conf" [profiles.home] config_file = "hyprconfigs/home.go.tmpl" config_file_type = "template" [profiles.home.static_template_values] mode = "productivity" # Default mode [[profiles.home.conditions.required_monitors]] name = "eDP-1" monitor_tag = "laptop" [[profiles.home.conditions.required_monitors]] name = "DP-11" monitor_tag = "gaming_monitor" ``` -------------------------------- ### Using Static Values in Templates Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md Demonstrates how to use defined static template values within monitor configurations. This example shows dynamic refresh rate selection based on AC power status. ```go monitor=eDP-1,{{.default_res}}@{{if isOnAC}}{{.refresh_rate_high}}{{else}}{{.refresh_rate_low}}{{end}},0x0,1,vrr,{{.default_vrr}} ``` -------------------------------- ### Install Release Candidate from AUR Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Install the release candidate version of the package from the Arch User Repository (AUR). This allows testing pre-release features. ```bash yay -S hyprdynamicmonitors-rc-bin ``` -------------------------------- ### Profile Configuration with Power States Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Example TOML configuration showing how to define required power states for a profile. This ensures the profile is only active when on AC power. ```toml [profiles.high_performance] # ... monitor conditions ... [[profiles.high_performance.conditions.required_power_states]] state = "AC" # Only active when on AC power ``` -------------------------------- ### Static Template Values Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md Example of setting static template values for a profile in TOML format. This is useful for defining consistent settings like mode, scaling, and VRR across different activities within a profile. ```toml [profiles.home.static_template_values] mode = "standard" scaling = "2.0" vrr_enabled = "1" ``` -------------------------------- ### Lid-Aware Docked Setup Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Manages monitor configuration for a docked setup, enabling dual monitors when the lid is open and only the external monitor when the lid is closed. Requires `--enable-lid-events`. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} {{- $external := index .MonitorsByTag "external" -}} {{if isLidClosed}} # Lid closed: external monitor only monitor={{$laptop.Name}},disable monitor={{$external.Name}},preferred,0x0,1 {{else}} # Lid open: dual monitor monitor={{$laptop.Name}},2880x1920@120,0x0,2.0 monitor={{$external.Name}},preferred,{{$laptop.Width}}x0,1 {{end}} ``` -------------------------------- ### Execute hyprdynamicmonitors on Startup Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md Ensure the hyprdynamicmonitors daemon runs automatically when Hyprland starts by adding the 'exec-once' command to your Hyprland configuration file. ```conf exec-once = hyprdynamicmonitors run ``` -------------------------------- ### Reapply Monitor Setup with SIGUSR1 Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/signals.md Send the SIGUSR1 signal to reapply the monitor setup without reloading the service configuration. This is useful when you need to force a configuration reapplication without altering any settings. ```bash kill -SIGUSR1 $(pidof hyprdynamicmonitors) ``` -------------------------------- ### Example Profile with Lid State Condition Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/lid-events.md This TOML snippet shows how to define a profile in `config.toml` that is only active when the laptop lid is closed. ```toml [profiles.docked] # ... monitor conditions ... [[profiles.docked.conditions.required_lid_states]] state = "Closed" # Only active when lid is closed ``` -------------------------------- ### Prepare HyprDynamicMonitors before running Hyprland Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/README.md Ensures HyprDynamicMonitors is prepared before Hyprland starts. This can be done manually from a TTY or by enabling a systemd service. ```bash # e.g. from a tty: hyprdynamicmonitors prepare && Hyprland # or use systemd # systemctl --user enable hyprdynamicmonitors-prepare.service ``` -------------------------------- ### Enable hyprdynamicmonitors prepare systemd service Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/prepare.md Enable the systemd user service for `hyprdynamicmonitors-prepare`. This service ensures the prepare command runs automatically before the graphical session starts. ```bash systemctl --user enable hyprdynamicmonitors-prepare.service ``` -------------------------------- ### Troubleshoot HyprDynamicMonitors Service Start Failures Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/systemd.md Command to view the last 50 lines of logs for the HyprDynamicMonitors service to diagnose startup issues. ```bash journalctl --user -u hyprdynamicmonitors -n 50 ``` -------------------------------- ### Reference Specific Monitors by Tag Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Access specific monitors using tags like 'laptop' or 'external' and configure their properties. Includes an example of retrieving the external monitor's description. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} {{- $external := index .MonitorsByTag "external" -}} monitor={{$laptop.Name}},2880x1920@120,0x0,2.0 monitor={{$external.Name}},preferred,auto,1 # External monitor description: {{$external.Description}} ``` -------------------------------- ### Run Daemon Once for Testing Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/setup-approaches.md Execute the daemon for a single cycle and then exit. This is helpful for quick tests to ensure the daemon starts and performs its basic function. ```bash # Run once and exit (for testing) hyprdynamicmonitors run --run-once ``` -------------------------------- ### Profile Structure Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/profiles.md Defines the structure of a profile in the TOML configuration file, including optional conditions for power state, lid state, and required monitors. ```toml [profiles.PROFILE_NAME] config_file = "path/to/config/file" # can be absolute or relative to the config.toml file config_file_type = "static" # or "template" [profiles.PROFILE_NAME.conditions] power_state = "AC" # optional: "AC" or "BAT" (requires --disable-power-events=false) lid_state = "Opened" # optional: "Opened" or "Closed" (requires --enable-lid-events) # at least one required_monitor needs to be defined in a given profile [[profiles.PROFILE_NAME.conditions.required_monitors]] name = "eDP-1" # optional but one of description/name is required description = "LG" # optional but one of description/name is required monitor_tag = "laptop" # optional match_description_using_regex = true # optional, defaults to false match_name_using_regex = true # optional, defaults to false ``` -------------------------------- ### Shell Execution: Using Pipes Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/callbacks.md Illustrates using shell pipes within a callback to process command output. This example checks if a specific monitor is active. ```toml post_apply_exec = "hyprctl monitors | grep -q eDP-1 && notify-send 'Laptop screen active'" ``` -------------------------------- ### Use isLidClosed Template Function Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/lid-events.md Example Go template demonstrating how to use the `isLidClosed` function to conditionally disable a monitor when the laptop lid is closed. ```go {{if isLidClosed}} # Disable laptop screen when lid is closed monitor=eDP-1,disable {{else}} monitor=eDP-1,2880x1920@120,0x0,2.0 {{end}} ``` -------------------------------- ### Profile Definition for Laptop Setup Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/overview.md Define a profile named 'laptop_only' that uses a static configuration file and requires a specific monitor ('eDP-1') to be present. ```toml [profiles.laptop_only] config_file = "hyprconfigs/laptop.conf" config_file_type = "static" [[profiles.laptop_only.conditions.required_monitors]] name = "eDP-1" ``` -------------------------------- ### Run HyprDynamicMonitors Directly with Nix Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md Execute the tool directly from its GitHub repository for quick testing without installation. Using a specific tag or version is recommended for stability. ```bash # Run directly from GitHub nix run github:fiffeek/hyprdynamicmonitors # Or from specific tag/version (recommended) nix run github:fiffeek/hyprdynamicmonitors/v1.0.0 ``` -------------------------------- ### Declarative Hyprland Config with Home Manager Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md Integrate HyprDynamicMonitors by sourcing its configuration within a declarative Hyprland setup using Home Manager. This ensures the monitor configurations are applied automatically. ```nix wayland.windowManager.hyprland = { enable = true; extraConfig = '' # Source the auto-generated monitors configuration source = ~/.config/hypr/monitors.conf ''; }; ``` -------------------------------- ### Prepare Command Help Output Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Displays the help information for the 'prepare' command, outlining its purpose, usage, and available flags. This is useful for understanding the command's functionality and options. ```text Prepares the monitor configuration file by removing monitor disable commands. This command should be run before starting Hyprland to ensure a clean state. It removes any 'monitor=...,disable' lines from the destination file, which prevents an issue with no active displays (Hyprland does not launch). This is particularly useful when running with systemd, where you want to ensure the monitor configuration is reset before the daemon manages profiles. Example: hyprdynamicmonitors prepare Usage: hyprdynamicmonitors prepare [flags] Flags: -h, --help help for prepare Global Flags: --config string Path to configuration file (default "$HOME/.config/hyprdynamicmonitors/config.toml") --debug Enable debug logging --enable-json-logs-format Enable structured logging --verbose Enable verbose logging ``` -------------------------------- ### Launch TUI with Lid Events Enabled Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Starts the TUI and enables listening to lid events via dbus. This is useful for laptops where lid open/close events should trigger configuration changes. ```bash hyprdynamicmonitors tui --enable-lid-events ``` -------------------------------- ### Get Monitor Information Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/monitor-matching.md Use `hyprctl monitors` to list all connected monitors and their properties. This output is used to identify monitor names and descriptions for configuration. ```bash $ hyprctl monitors Monitor eDP-1 (ID 0): 2880x1920@120.00000 at 0x0 description: BOE 0x0C6B ... ``` -------------------------------- ### Initial Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md This TOML configuration sets up the general destination for generated monitor configurations and defines a 'home' profile with a template file and conditions for required monitors. ```toml [general] destination = "$HOME/.config/hypr/config.d/99_autogenerated-monitors.conf" [profiles.home] config_file = "hyprconfigs/home.go.tmpl" config_file_type = "template" [[profiles.home.conditions.required_monitors]] name = "eDP-1" monitor_tag = "laptop" [[profiles.home.conditions.required_monitors]] name = "DP-11" monitor_tag = "external" ``` -------------------------------- ### Verify Hyprdynamicmonitors Installation Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/nix.md Run this command to check if the hyprdynamicmonitors package has been successfully installed. ```bash hyprdynamicmonitors --version ``` -------------------------------- ### Install HyprDynamicMonitors using AUR Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/README.md Installs the HyprDynamicMonitors package on Arch Linux using an AUR helper. ```bash # AUR (Arch Linux) $aurHelper -S hyprdynamicmonitors-bin ``` -------------------------------- ### Install UPower on Fedora Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Install the UPower package on Fedora systems. UPower is a dependency for hyprdynamicmonitors to function with power events. ```bash sudo dnf install upower ``` -------------------------------- ### Conditional Monitor Configuration using Power State Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/power-events.md Example of using the `isOnAC` function within Hyprland templates to conditionally set monitor configurations based on whether the system is on AC power or battery. ```go {{if isOnAC}} monitor=eDP-1,2880x1920@120,0x0,2.0 {{else}} monitor=eDP-1,1920x1080@60,0x0,2.0 {{end}} ``` -------------------------------- ### Running Prepare Command with Debug Logging Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Illustrates how to run the 'prepare' command with the '--debug' flag enabled. This is helpful for troubleshooting and understanding which monitor configurations are being modified or removed. ```bash hyprdynamicmonitors --debug prepare ``` -------------------------------- ### Conventional Commit Message Examples Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Examples of commit messages following the Conventional Commits specification. Pre-commit hooks validate this format. ```bash feat: add support for custom monitor tags fix: resolve template rendering issue docs: update TUI documentation test: add integration test for power events chore: update dependencies ``` -------------------------------- ### Install UPower on Arch Linux Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Install the UPower package on Arch Linux systems. UPower is required for hyprdynamicmonitors to detect power state changes. ```bash sudo pacman -S upower ``` -------------------------------- ### Run Pywal to Generate Theme Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/theming.md Execute Pywal with a wallpaper image to generate the color scheme and theme file. ```bash wal -i /path/to/wallpaper.png ``` -------------------------------- ### Initial Template Content Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md This Go template defines the initial monitor configuration for the 'home' profile, including specific monitor details and TUI markers for auto-generation. ```go-template # <<<<< TUI AUTO START monitor=desc:BOE NE135A1M-NY1,2880x1920@120.00000,0x0,2.00000000,transform,0,vrr,1 monitor=desc:LG Electronics LG SDQHD 301NTBKDU037,2560x2880@59.96700,-1800x0,1.60000000,transform,3,vrr,0 # <<<<< TUI AUTO END ``` -------------------------------- ### Nix Support Commands Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Experimental commands for building and running NixOS module and home-manager VMs. ```bash make nix/build/module # Build NixOS module VM ``` ```bash make nix/build/homemanager # Build home-manager VM ``` ```bash make nix/run/module # Run NixOS module VM ``` ```bash make nix/run/homemanager # Run home-manager VM ``` -------------------------------- ### HyprDynamicMonitors Run Command Help Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Provides detailed help for the 'run' command, including specific flags for controlling its behavior. Use this to understand options like dry-run, power event handling, and hot-reloading. ```text Run the HyprDynamicMonitors service to continuously monitor for display changes and automatically apply matching configuration profiles. Usage: hyprdynamicmonitors run [flags] Flags: --connect-to-session-bus Connect to session bus instead of system bus for power events: https://wiki.archlinux.org/title/D-Bus. You can switch as long as you expose power line events in your user session bus. --disable-auto-hot-reload Disable automatic hot reload (no file watchers) --disable-power-events Disable power events (dbus). Defaults to true if running on desktop, to false otherwise --dry-run Show what would be done without making changes --enable-lid-events Enable listening to dbus lid events -h, --help help for run --run-once Run once and exit immediately Global Flags: --config string Path to configuration file (default "$HOME/.config/hyprdynamicmonitors/config.toml") --debug Enable debug logging --enable-json-logs-format Enable structured logging --verbose Enable verbose logging ``` -------------------------------- ### Uninstall Project Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Removes the project from the installation directory. ```bash make uninstall ``` -------------------------------- ### Get Current Power State Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Access the current power state, which can be either 'AC' or 'BAT'. ```go {{.PowerState}} # Returns "AC" or "BAT" ``` -------------------------------- ### Using Static Template Values in Monitor Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Demonstrates how to reference static template values within monitor configuration strings. ```go monitor=eDP-1,{{.default_res}}@{{.refresh_rate_high}},0x0,1,vrr,{{.default_vrr}} ``` -------------------------------- ### Integrate hyprdynamicmonitors prepare into a startup script Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/prepare.md Include `hyprdynamicmonitors prepare` in your custom startup script before the Hyprland command. This ensures the monitor configuration is cleaned up prior to Hyprland initialization. ```bash #!/bin/bash # Your existing setup commands killall waybar # example cleanup # Add prepare before launching Hyprland hyprdynamicmonitors prepare Hyprland ``` -------------------------------- ### Reload Systemd and Start HyprDynamicMonitors Service Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/systemd.md Reloads the systemd user environment and enables/starts the HyprDynamicMonitors service and its prepare service. ```bash systemctl --user daemon-reload systemctl --user enable --now hyprdynamicmonitors.service systemctl --user enable hyprdynamicmonitors-prepare.service ``` -------------------------------- ### Open TUI for Monitor Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md Launch the TUI to interactively configure monitors for presentation mode. ```bash hyprdynamicmonitors tui ``` -------------------------------- ### View All Development Commands Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Displays a list of all available make commands for development tasks. ```bash make help ``` -------------------------------- ### Lid Event Signal Output Example Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/lid-events.md This shows the expected output format when the lid state changes and is monitored via D-Bus. ```bash /org/freedesktop/UPower: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.UPower', {'LidIsClosed': }, @as []) /org/freedesktop/UPower: org.freedesktop.DBus.Properties.PropertiesChanged ('org.freedesktop.UPower', {'LidIsClosed': }, @as []) ``` -------------------------------- ### Match Monitor by Description using Regex Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/monitor-matching.md Enable regex matching for monitor descriptions by setting 'match_description_using_regex' to true. This provides advanced pattern matching for monitor models. ```toml [[profiles.laptop_only.conditions.required_monitors]] description = "Dell.*" match_description_using_regex = true ``` -------------------------------- ### Get Current Lid State Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Retrieve the current lid state, which can be 'UNKNOWN', 'Closed', or 'Opened'. Requires the --enable-lid-events flag. ```go {{.LidState}} # Returns "UNKNOWN", "Closed", or "Opened" ``` -------------------------------- ### Launch TUI with Custom Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/tui.md Use this option to specify a custom TOML configuration file for the TUI. ```bash hyprdynamicmonitors tui --config /path/to/config.toml ``` -------------------------------- ### Enable and Start Hyprdynamicmonitors Systemd Service Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/setup-approaches.md Manages the Hyprdynamicmonitors daemon using systemd, ensuring it runs automatically on user login and is enabled. ```bash systemctl --user daemon-reload systemctl --user enable --now hyprdynamicmonitors.service ``` -------------------------------- ### Run Prepare Command and Hyprland Manually Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/setup-approaches.md Executes the 'prepare' command to clean up monitor configurations before manually launching Hyprland from a shell script or alias. ```bash # Add to your shell alias or startup script hyprdynamicmonitors prepare && Hyprland ``` -------------------------------- ### Run Hyprdynamicmonitors Daemon Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/setup-approaches.md Starts the Hyprdynamicmonitors daemon for automatic profile switching. This can be added to Hyprland's configuration or managed via systemd. ```conf # Add to ~/.config/hypr/hyprland.conf exec-once = hyprdynamicmonitors run ``` -------------------------------- ### List Available UPower Devices Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Execute this command to list all available UPower devices on your system. This is useful for identifying the correct device path when manual configuration is needed. ```bash upower -e ``` -------------------------------- ### Reload and Check Systemd User Services Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/systemd.md Reload systemd definitions and check the status of HyprDynamicMonitors user services. This is useful after installation or configuration changes. ```bash systemctl --user daemon-reload systemctl --user status hyprdynamicmonitors.service systemctl --user status hyprdynamicmonitors-prepare.service ``` -------------------------------- ### Record Demos and Previews Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Commands for recording demos and previews using vhs. Allows recording a specific preview tape or all preview tapes. ```bash make demo # Record demo preview (requires vhs) ``` ```bash make record/preview RECORD_TARGET=demo # Record specific preview tape ``` ```bash make record/previews # Record all preview tapes ``` -------------------------------- ### Hyprland Configuration for Custom systemd Target Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/systemd.md Configure Hyprland to start and stop a custom systemd target, enabling precise control over the service lifecycle. ```conf exec-once = systemctl --user start hyprland-custom-session.target bind = $mainMod, X, exec, systemctl --user stop hyprland-custom-session.target ``` -------------------------------- ### Fallback Profile Configuration Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/overview.md Specify a fallback profile to be used when no other profiles match the current system state. This example uses a static configuration file. ```toml [fallback_profile] config_file = "hyprconfigs/fallback.conf" config_file_type = "static" ``` -------------------------------- ### Power-Aware Dual Monitor Setup Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/advanced/templates.md Configures dual monitors with different resolutions and refresh rates based on whether the system is on AC power or battery. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} {{- $external := index .MonitorsByTag "external" -}} {{if isOnAC}} # AC Power: High performance monitor={{$laptop.Name}},2880x1920@120,0x0,2.0 monitor={{$external.Name}},3840x2160@60,2880x0,1 {{else}} # Battery: Power saving monitor={{$laptop.Name}},1920x1080@60,0x0,2.0 monitor={{$external.Name}},2560x1440@60,1920x0,1 {{end}} ``` -------------------------------- ### Run Integration Tests Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Execute integration tests, which build the binary and verify expected outputs. These tests are located in the 'test/' directory. ```bash make test/integration ``` -------------------------------- ### Dynamic Workspace Assignment with Go Templates Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/faq.md Use Go templates to dynamically assign workspaces to monitors based on tags. This allows for more flexible profile generation. ```go {{- $laptop := index .MonitorsByTag "laptop" -}} {{- $external := index .MonitorsByTag "external" -}} monitor={{$laptop.Name}},preferred,0x0,1 monitor={{$external.Name}},preferred,1920x0,1 workspace=1,monitor:{{$laptop.Name}},default:true workspace=2,monitor:{{$external.Name}},default:true workspace=3,monitor:{{$external.Name}} ``` -------------------------------- ### Get Power Device Information Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/power-events.md Retrieve detailed information about a specific power device. This is useful for verifying the online status (AC or battery power). ```bash upower -i /org/freedesktop/UPower/devices/line_power_ACAD ``` -------------------------------- ### Shell Execution: Multiple Commands Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/configuration/callbacks.md Demonstrates executing multiple commands sequentially using '&&' within a callback. This is useful for chained operations. ```toml post_apply_exec = "hyprctl reload && sleep 1 && notify-send 'Done'" ``` -------------------------------- ### Build Release Binaries Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Commands for building release binaries for local use or release candidates across all platforms. Also includes building binaries for testing and documentation generation. ```bash make release/local # Build release binaries for all platforms ``` ```bash make release/local/rc # Build release candidate binaries ``` ```bash make build/test # Build test binary with coverage for integration tests ``` ```bash make build/docs # Build binary for documentation generation ``` -------------------------------- ### Run HyprDynamicMonitors with Options Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/usage/commands.md Demonstrates various ways to run the HyprDynamicMonitors service with different flags to control its behavior, such as performing a dry run, running once, disabling power events, or enabling lid events. ```bash # Run the service normally hyprdynamicmonitors run # Run with dry-run to see what would happen hyprdynamicmonitors run --dry-run # Run once and exit (useful for testing) hyprdynamicmonitors run --run-once # Disable power events hyprdynamicmonitors run --disable-power-events # Enable lid events hyprdynamicmonitors run --enable-lid-events ``` -------------------------------- ### Run Hyprdynamicmonitors with Nix Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/quickstart/installation.md Execute Hyprdynamicmonitors directly using Nix, either from the main branch or a specific tag. Installation to the Nix profile is also supported. ```bash # Run directly from GitHub nix run github:fiffeek/hyprdynamicmonitors ``` ```bash # Or from specific tag/version (recommended) nix run github:fiffeek/hyprdynamicmonitors/v1.0.0 ``` ```bash # Install to profile nix profile install github:fiffeek/hyprdynamicmonitors ``` -------------------------------- ### Add Delay for Lid Events on Boot/Resume Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/lid-events.md To prevent unwanted profile switches during system boot or resume, add a delay before starting hyprdynamicmonitors in your Hyprland configuration. ```toml exec-once = sleep 2 && hyprdynamicmonitors run --enable-lid-events ``` -------------------------------- ### Complete Configuration with Mode Variable Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/guides/ad-hoc.md This TOML configuration includes the general settings, the 'home' profile definition, the new `mode` static variable, and the required monitor conditions. ```toml [general] destination = "$HOME/.config/hypr/config.d/99_autogenerated-monitors.conf" [profiles.home] config_file = "hyprconfigs/home.go.tmpl" config_file_type = "template" [profiles.home.static_template_values] mode = "standard" [[profiles.home.conditions.required_monitors]] name = "eDP-1" monitor_tag = "laptop" [[profiles.home.conditions.required_monitors]] name = "DP-11" monitor_tag = "external" ``` -------------------------------- ### Run Pre-Push CI Pipeline Source: https://github.com/fiffeek/hyprdynamicmonitors/blob/main/docs/docs/development.md Executes the full Continuous Integration pipeline before pushing code. ```bash make pre-push ```