Skip to content

fix(hypr): align window/layer rules and source includes with latest syntax#1612

Closed
NZ-247 wants to merge 1 commit into
HyDE-Project:masterfrom
NZ-247:fix/hyprland-unified-windowrule-syntax
Closed

fix(hypr): align window/layer rules and source includes with latest syntax#1612
NZ-247 wants to merge 1 commit into
HyDE-Project:masterfrom
NZ-247:fix/hyprland-unified-windowrule-syntax

Conversation

@NZ-247
Copy link
Copy Markdown

@NZ-247 NZ-247 commented Feb 28, 2026

Summary

This PR updates HyDE's Hyprland configuration templates to match the current unified windowrule/layerrule syntax used by recent Hyprland releases.

The goal is to stop parse failures such as:

  • invalid field type idleinhibit
  • invalid field title
  • invalid field float: missing a value
  • invalid field blur: missing a value
  • source= globbing error: found no match

What changed

1) Window rules syntax alignment

Updated window/layer rules to the current style in:

  • Configs/.config/hypr/windowrules.conf
  • Configs/.local/share/hyde/templates/hypr/windowrules.conf
  • Configs/.local/share/hypr/windowrules.conf

Key updates include:

  • windowrulev2-style/legacy patterns consolidated to current windowrule format.
  • modern match fields retained/normalized (match:class, match:title, match:tag, match:fullscreen, match:initial_title).
  • boolean/value fields made explicit (float on, pin on, no_initial_focus on, keep_aspect_ratio on).
  • idle_inhibit fullscreen rules adjusted to current filter usage (match:fullscreen 1).
  • layer rules updated to value-based format (blur on, ignore_alpha 0, no_anim on).
  • removed legacy override token usage in opacity rules ($& / override style fragments).

2) source robustness / globbing fixes

Updated includes to avoid relative/globbing failures in:

  • Configs/.config/hypr/hyprland.conf
  • Configs/.config/hypr/animations.conf
  • Configs/.config/hypr/workflows.conf
  • Configs/.local/share/hypr/hyprland.conf

Key updates include:

  • switched critical source lines from relative paths (./...) to stable absolute/user-home based paths.
  • kept fallback include behavior while reducing dependency on cwd-sensitive path resolution.

Why this is needed

After newer Hyprland updates, users hit cascading parser errors from outdated field names/value forms and older include path assumptions. These changes align HyDE defaults/templates with current syntax and prevent first-run breakage after updates.

Scope and compatibility notes

  • This PR focuses on syntax compatibility and load robustness only.
  • No behavior-intent changes were introduced beyond parser compatibility.
  • Existing workflow/animation selection behavior is preserved.

Validation

Validated by reviewing all affected Hypr files for:

  • absence of legacy broken tokens (e.g. $&, old layer rule value-less forms),
  • consistent use of current windowrule/layerrule value syntax,
  • non-relative source paths in critical entry templates.

References

Summary by CodeRabbit

  • Chores
    • Updated configuration file path references to use absolute paths for improved reliability and portability.
    • Modernized window rule syntax across configuration files for consistency with current standards.
    • Consolidated window rule definitions for simplified configuration management.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Warning: PR targeting master branch detected!

This PR is targeting master but should target dev instead.

According to our Quarterly Release Policy:

  • All pull requests must be submitted to the dev branch
  • Changes go through dev first for testing before being merged to master during quarterly release windows (1st & 3rd Fridays)
  • PRs to master are only allowed for emergencies

Required Action:

  1. Change the base branch from master to dev
  2. Follow the pull request template

If this is an emergency fix, please add a comment explaining why it needs to target master directly.


This is an automated message enforcing our quarterly release workflow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

This pull request modernizes Hyprland configuration files by converting relative source paths to absolute $HOME-based paths, refactoring window rules from block-based to single-line syntax, and updating legacy boolean flags (true/false) to current format (on/off) across multiple configuration files.

Changes

Cohort / File(s) Summary
Path Resolution Updates
Configs/.config/hypr/animations.conf, Configs/.config/hypr/workflows.conf, Configs/.config/hypr/hyprland.conf
Converted relative source paths (e.g., ./animations/theme.conf) to absolute $HOME-based paths ($HOME/.config/hypr/...), ensuring consistent config file resolution from user home directory.
Shared Hyprland Configuration
Configs/.local/share/hypr/hyprland.conf
Updated file path references from local relative sources to absolute paths under $HOME/.local/share/hypr/ directory for all included config files (variables, defaults, windowrules, etc.).
Window Rules Refactoring - Main Config
Configs/.config/hypr/windowrules.conf
Consolidated block-based windowrule declarations into flat, single-line format; modernized opacity syntax from 0.90 $& 0.90 $& 1 to 0.90 0.90; updated boolean flags from true to on; refactored idle/inhibit, Picture-in-Picture, and layerrule syntax to use match attributes.
Window Rules Refactoring - Template
Configs/.local/share/hyde/templates/hypr/windowrules.conf
Migrated from block-based rules to unified single-line windowrule declarations; updated opacity override semantics; refactored Picture-in-Picture tag-based rules; modernized float/focus/layout directives with current boolean and match syntax.
Window Rules Refactoring - Shared
Configs/.local/share/hypr/windowrules.conf
Replaced block-based windowrule and layerrule definitions with compact inline single-line declarations; consolidated portal dialogs, floating apps, and Picture-in-Picture rules into explicit tag-based and class/title match statements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 The configs shimmer, old paths flee,
Absolute homes, now clear to see!
From nested blocks to lines so flat,
Boolean banners in modern hat!
Hyprland hops with joy today! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating Hyprland configuration syntax and source paths to align with the latest Hyprland version requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
Configs/.local/share/hypr/hyprland.conf (1)

19-35: Consider extracting a shared base path variable for include lines.

This removes repetition and lowers drift risk when include roots change again.

🧩 Optional refactor
+$HYPR_SHARED_PATH = $HOME/.local/share/hypr
+
-source = $HOME/.local/share/hypr/variables.conf
+source = $HYPR_SHARED_PATH/variables.conf
-source = $HOME/.local/share/hypr/migration.conf
+source = $HYPR_SHARED_PATH/migration.conf
-source = $HOME/.local/share/hypr/defaults.conf
+source = $HYPR_SHARED_PATH/defaults.conf
-source = $HOME/.local/share/hypr/windowrules.conf
+source = $HYPR_SHARED_PATH/windowrules.conf
-source = $HOME/.local/share/hypr/env.conf
+source = $HYPR_SHARED_PATH/env.conf
-source = $HOME/.local/share/hypr/dynamic.conf
+source = $HYPR_SHARED_PATH/dynamic.conf
-source = $HOME/.local/share/hypr/startup.conf
+source = $HYPR_SHARED_PATH/startup.conf
-source = $HOME/.local/share/hypr/finale.conf
+source = $HYPR_SHARED_PATH/finale.conf

Also applies to: 41-41, 50-50

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.local/share/hypr/hyprland.conf` around lines 19 - 35, Introduce a
single reusable base variable (e.g., HYPR_BASE or HYPR_DIR) at the top of the
config and replace repeated "source = $HOME/.local/share/hypr/..." include lines
with "source = ${HYPR_BASE}/<file>" for each referenced file (variables.conf,
migration.conf, defaults.conf, windowrules.conf, env.conf, dynamic.conf, etc.);
update any other include lines elsewhere to use the same variable so the include
root is declared once and all "source =" entries reference that variable.
Configs/.local/share/hypr/windowrules.conf (1)

15-15: Remove duplicate regex alternative in floating-app matcher.

blueman-manager appears twice in the same alternation; dropping one keeps the rule easier to maintain.

♻️ Suggested cleanup
-windowrule = tag +hyde_floating_apps, match:class ^(blueman-manager|pavucontrol-qt|com\.gabm\.satty|vlc|kvantummanager|qt[56]ct|nwg-(look|displays)|org\.kde\.ark|org\.pulseaudio\.pavucontrol|blueman-manager|nm-(applet|connection-editor)|org\.kde\.polkit-kde-authentication-agent-1|console-dropdown)$
+windowrule = tag +hyde_floating_apps, match:class ^(blueman-manager|pavucontrol-qt|com\.gabm\.satty|vlc|kvantummanager|qt[56]ct|nwg-(look|displays)|org\.kde\.ark|org\.pulseaudio\.pavucontrol|nm-(applet|connection-editor)|org\.kde\.polkit-kde-authentication-agent-1|console-dropdown)$
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.local/share/hypr/windowrules.conf` at line 15, The windowrule's
match:class regex contains a duplicate alternation "blueman-manager"; update the
pattern used by the windowrule (the match:class value) to remove the redundant
"blueman-manager" alternative so each app appears only once, ensuring the
alternation list (e.g., entries like pavucontrol-qt, com\.gabm\.satty, vlc,
kvantummanager, qt[56]ct, nwg-(look|displays), org\.kde\.ark,
org\.pulseaudio\.pavucontrol, nm-(applet|connection-editor),
org\.kde\.polkit-kde-authentication-agent-1, console-dropdown) remains unchanged
aside from dropping the duplicate.
Configs/.config/hypr/workflows.conf (1)

17-18: Use $WORKFLOWS_PATH for source to avoid path drift.

You already define the path in Line 17; sourcing that variable keeps one source of truth.

🔧 Suggested change
 $WORKFLOWS_PATH = $HOME/.config/hypr/workflows/default.conf
-source = $HOME/.config/hypr/workflows/default.conf
+source = $WORKFLOWS_PATH
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.config/hypr/workflows.conf` around lines 17 - 18, Replace the
hardcoded path in the source assignment with the previously defined variable to
keep a single source of truth: change the source line to reference
$WORKFLOWS_PATH instead of the literal $HOME/.config/hypr/workflows/default.conf
(the variable is defined as WORKFLOWS_PATH on the prior line).
Configs/.config/hypr/animations.conf (1)

11-12: Reuse $ANIMATION_PATH in source to keep one path definition.

This prevents future mismatch if the path is updated in one place only.

🔧 Suggested change
 $ANIMATION_PATH=$HOME/.config/hypr/animations/theme.conf
-source = $HOME/.config/hypr/animations/theme.conf
+source = $ANIMATION_PATH
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.config/hypr/animations.conf` around lines 11 - 12, The file defines
$ANIMATION_PATH but then duplicates the literal path in the source line; update
the source line to reuse the variable by changing the source assignment to
reference $ANIMATION_PATH (i.e., set source = $ANIMATION_PATH) so there is a
single canonical path (watch for correct variable name casing and existing
$ANIMATION_PATH definition).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Configs/.config/hypr/hyprland.conf`:
- Around line 23-26: Replace hardcoded include paths that reference
"$HOME/.config" (the lines beginning "source =
$HOME/.config/hypr/keybindings.conf", "source =
$HOME/.config/hypr/windowrules.conf", "source =
$HOME/.config/hypr/monitors.conf", and "source =
$HOME/.config/hypr/userprefs.conf") to use "$XDG_CONFIG_HOME" instead so the
config respects a custom XDG_CONFIG_HOME; update each "source =" line to
reference "$XDG_CONFIG_HOME/hypr/..." (ensure the variable is used consistently
like other files such as shaders.conf).

In `@Configs/.local/share/hyde/templates/hypr/windowrules.conf`:
- Line 80: The comment on the windowrule line referencing the app label is
misspelled; update the trailing comment on the rule "windowrule = float
on,match:class ^(com.github.unrud.VideoDownloader)$" to read
"VideoDownloader-Gtk" instead of "VideoDownloader-Gkk" so it matches the toolkit
naming used elsewhere.

---

Nitpick comments:
In `@Configs/.config/hypr/animations.conf`:
- Around line 11-12: The file defines $ANIMATION_PATH but then duplicates the
literal path in the source line; update the source line to reuse the variable by
changing the source assignment to reference $ANIMATION_PATH (i.e., set source =
$ANIMATION_PATH) so there is a single canonical path (watch for correct variable
name casing and existing $ANIMATION_PATH definition).

In `@Configs/.config/hypr/workflows.conf`:
- Around line 17-18: Replace the hardcoded path in the source assignment with
the previously defined variable to keep a single source of truth: change the
source line to reference $WORKFLOWS_PATH instead of the literal
$HOME/.config/hypr/workflows/default.conf (the variable is defined as
WORKFLOWS_PATH on the prior line).

In `@Configs/.local/share/hypr/hyprland.conf`:
- Around line 19-35: Introduce a single reusable base variable (e.g., HYPR_BASE
or HYPR_DIR) at the top of the config and replace repeated "source =
$HOME/.local/share/hypr/..." include lines with "source = ${HYPR_BASE}/<file>"
for each referenced file (variables.conf, migration.conf, defaults.conf,
windowrules.conf, env.conf, dynamic.conf, etc.); update any other include lines
elsewhere to use the same variable so the include root is declared once and all
"source =" entries reference that variable.

In `@Configs/.local/share/hypr/windowrules.conf`:
- Line 15: The windowrule's match:class regex contains a duplicate alternation
"blueman-manager"; update the pattern used by the windowrule (the match:class
value) to remove the redundant "blueman-manager" alternative so each app appears
only once, ensuring the alternation list (e.g., entries like pavucontrol-qt,
com\.gabm\.satty, vlc, kvantummanager, qt[56]ct, nwg-(look|displays),
org\.kde\.ark, org\.pulseaudio\.pavucontrol, nm-(applet|connection-editor),
org\.kde\.polkit-kde-authentication-agent-1, console-dropdown) remains unchanged
aside from dropping the duplicate.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7493044 and 360aaa5.

📒 Files selected for processing (7)
  • Configs/.config/hypr/animations.conf
  • Configs/.config/hypr/hyprland.conf
  • Configs/.config/hypr/windowrules.conf
  • Configs/.config/hypr/workflows.conf
  • Configs/.local/share/hyde/templates/hypr/windowrules.conf
  • Configs/.local/share/hypr/hyprland.conf
  • Configs/.local/share/hypr/windowrules.conf

Comment on lines +23 to +26
source = $HOME/.config/hypr/keybindings.conf
source = $HOME/.config/hypr/windowrules.conf
source = $HOME/.config/hypr/monitors.conf
source = $HOME/.config/hypr/userprefs.conf
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# First, check if the file exists and display lines 23-26
echo "=== Content at lines 23-26 of hyprland.conf ==="
if [ -f "Configs/.config/hypr/hyprland.conf" ]; then
  sed -n '23,26p' "Configs/.config/hypr/hyprland.conf"
else
  echo "File not found"
fi

echo
echo "=== All files in Configs/.config/hypr/ ==="
ls -la "Configs/.config/hypr/" 2>/dev/null || echo "Directory not found"

echo
echo "=== Checking for HOME-based includes across hypr config files ==="
find Configs/.config/hypr -name "*.conf" -type f 2>/dev/null | while read file; do
  if rg -q '\$HOME/\.config' "$file"; then
    echo "Found in: $file"
    rg -n '\$HOME/\.config' "$file" || true
  fi
done

echo
echo "=== Checking for XDG_CONFIG_HOME-based includes across hypr config files ==="
find Configs/.config/hypr -name "*.conf" -type f 2>/dev/null | while read file; do
  if rg -q '\$XDG_CONFIG_HOME' "$file"; then
    echo "Found in: $file"
    rg -n '\$XDG_CONFIG_HOME' "$file" || true
  fi
done

Repository: HyDE-Project/HyDE

Length of output: 2650


Use $XDG_CONFIG_HOME instead of hardcoding $HOME/.config in include paths.

Hardcoding $HOME/.config prevents configs from being found when users set a custom XDG_CONFIG_HOME. While $XDG_CONFIG_HOME defaults to $HOME/.config, respecting the environment variable is the proper approach. Note: other files in the directory already use $XDG_CONFIG_HOME (e.g., shaders.conf), so this change improves consistency.

Suggested adjustment
-source = $HOME/.config/hypr/keybindings.conf
-source = $HOME/.config/hypr/windowrules.conf
-source = $HOME/.config/hypr/monitors.conf
-source = $HOME/.config/hypr/userprefs.conf
+source = $XDG_CONFIG_HOME/hypr/keybindings.conf
+source = $XDG_CONFIG_HOME/hypr/windowrules.conf
+source = $XDG_CONFIG_HOME/hypr/monitors.conf
+source = $XDG_CONFIG_HOME/hypr/userprefs.conf
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.config/hypr/hyprland.conf` around lines 23 - 26, Replace hardcoded
include paths that reference "$HOME/.config" (the lines beginning "source =
$HOME/.config/hypr/keybindings.conf", "source =
$HOME/.config/hypr/windowrules.conf", "source =
$HOME/.config/hypr/monitors.conf", and "source =
$HOME/.config/hypr/userprefs.conf") to use "$XDG_CONFIG_HOME" instead so the
config respects a custom XDG_CONFIG_HOME; update each "source =" line to
reference "$XDG_CONFIG_HOME/hypr/..." (ensure the variable is used consistently
like other files such as shaders.conf).

windowrule = float on,match:class ^(eog)$ # Imageviewer-Gtk
windowrule = float on,match:class ^(io.github.alainm23.planify)$ # planify-Gtk
windowrule = float on,match:class ^(io.gitlab.theevilskeleton.Upscaler)$ # Upscaler-Gtk
windowrule = float on,match:class ^(com.github.unrud.VideoDownloader)$ # VideoDownloader-Gkk
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix app label typo in comment.

Line 80 says VideoDownloader-Gkk; this should be VideoDownloader-Gtk for consistency with the app/toolkit naming used elsewhere.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Configs/.local/share/hyde/templates/hypr/windowrules.conf` at line 80, The
comment on the windowrule line referencing the app label is misspelled; update
the trailing comment on the rule "windowrule = float on,match:class
^(com.github.unrud.VideoDownloader)$" to read "VideoDownloader-Gtk" instead of
"VideoDownloader-Gkk" so it matches the toolkit naming used elsewhere.

@rubiin rubiin self-requested a review March 23, 2026 15:02
@kRHYME7 kRHYME7 closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants