Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windowrulev2 Fails to Match Uppercase class (Hyprland 0.47.2, Arch Linux 6.13.2) #9457

Closed
2 of 6 tasks
liiil825 opened this issue Feb 21, 2025 · 4 comments
Closed
2 of 6 tasks
Labels
bug Something isn't working

Comments

@liiil825
Copy link

Already reported ? *

  • I have searched the existing open and closed issues.

Regression?

I don't know, I started using Hyprland only recently

System Info and Hyprland Version

hyprctl systeminfo
Hyprland 0.47.2 built from branch at commit 882f7ad (version: bump to 0.47.2).
Date: Sun Feb 2 00:47:17 2025
Tag: v0.47.2, commits: 5767
built against:
aquamarine 0.7.2
hyprlang 0.6.0
hyprutils 0.5.0
hyprcursor 0.1.11
hyprgraphics 0.1.2

no flags were set

System Information:
System name: Linux
Node name: archlinux-david
Release: 6.13.2-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000

GPU information:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106 [GeForce GTX 1650] [10de:1f0a] (rev a1) (prog-if 00 [VGA controller])
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64 570.86.16 Release Build (archlinux-builder@)

os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo

plugins:

Description

Problem Description:

When using Hyprland 0.47.2 (running on Arch Linux 6.13.2-arch1-1), I encountered an issue where windowrule rules fail to match uppercase class values.

According to the output of the hyprctl clients command, the class field of some applications is displayed in uppercase, for example:

Window 62527ee29f40 -> main.tsx - maliang - Cursor:
...
class: Cursor
...

Window 62527ee20bb0 -> Window Rules – Hyprland Wiki - Chromium:
...
class: Chromium
...
However, when I use these uppercase class values in my hyprland.conf file to set windowrule rules, these rules do not take effect. For example:

windowrulev2 = workspace 1, class:Cursor
windowrulev2 = workspace 2, class:Chromium
When I try using lowercase class values, the rules work as expected:

windowrulev2 = workspace 1, class:cursor
windowrulev2 = workspace 2, class:chromium
Expected Behavior:

windowrule rules should be able to correctly match uppercase class values displayed in the hyprctl clients output.

Environment Information:

Hyprland Version: 0.47.2
Operating System: Arch Linux 6.13.2-arch1-1
Compositor: Hyprland
Using XWayland: Yes (for some applications)
Steps to Reproduce:

Run the hyprctl clients command and observe if the class field of any applications is in uppercase.
Use these uppercase class values to set windowrule rules in the hyprland.conf file.
Reload the Hyprland configuration file (hyprctl reload).
Observe if the rules take effect.
Additional Information:

I have tried using the xprop and xtrace commands to inspect the window classes, but found no anomalies.
I have tried creating a minimal hyprland.conf file, but the issue persists.
Request for Assistance:

Please help me troubleshoot this issue and provide a solution. If this is a known issue, please inform me if there are any plans for a fix.

Labels:

bug
windowrule
class
case-sensitive
Notes:

You can modify and supplement the issue description based on your actual situation.

How to reproduce

  1. Ensure you have Hyprland 0.47.2 and XWayland installed on your system.

  2. Open a terminal and run the hyprctl clients command.

  3. Locate the window information for the Cursor and Chromium applications, and confirm that their class fields are displayed in uppercase letters.

  4. Open your Hyprland configuration file ~/.config/hypr/hyprland.conf.

  5. Add the following windowrule rules to the configuration file:

windowrule = workspace 1, class:Cursor
windowrule = workspace 2, class:Chromium
  1. Save the configuration file and reload it by running the hyprctl reload command in the terminal.

  2. Open the Cursor and Chromium applications.

  3. Observe whether the applications are moved to workspace 1 and workspace 2.

9, If the applications are not moved correctly, the bug is successfully reproduced.

Attach not paste

  • I understand that all text files must be attached, and not pasted directly. If not respected, this issue will likely get closed as spam

Checklist of files to include below

  • Hyprland config - hyprctl systeminfo -c (always include)
  • Crash report (always include in case of crash)
  • Video (always include in case of a visual bug)
  • Logs (might contain useful info such as errors)

Additional info & File uploads

No response

@liiil825 liiil825 added the bug Something isn't working label Feb 21, 2025
@vaxerski
Copy link
Member

that's odd. Can you show what the hyprctl clients output looks like for one of these windows?

@liiil825
Copy link
Author

that's odd. Can you show what the hyprctl clients output looks like for one of these windows?

hyprctl clients
Window 5b82605633a0 -> New Tab - Chromium:
mapped: 1
hidden: 0
at: 7,37
size: 2546,1396
workspace: 2 (2)
floating: 0
pseudo: 0
monitor: 0
class: Chromium
title: New Tab - Chromium
initialClass: Chromium
initialTitle: New Tab - Chromium
pid: 2403
xwayland: 1
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 3
inhibitingIdle: 0

Window 5b8260725380 -> AppFlowy:
mapped: 1
hidden: 0
at: 7,37
size: 1268,1396
workspace: 4 (4)
floating: 0
pseudo: 0
monitor: 0
class: appflowy
title: AppFlowy
initialClass: appflowy
initialTitle: AppFlowy
pid: 3196
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 5
inhibitingIdle: 0

Window 5b82609f8400 -> Telegram (650):
mapped: 1
hidden: 0
at: 7,37
size: 2546,1396
workspace: 5 (5)
floating: 0
pseudo: 0
monitor: 0
class: org.telegram.desktop._b17b29ea9ff28ec53d9f0a54e7944451
title: Telegram (650)
initialClass: org.telegram.desktop._b17b29ea9ff28ec53d9f0a54e7944451
initialTitle: Telegram
pid: 2857
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 6
inhibitingIdle: 0

Window 5b82609e5e70 -> AuthContext.tsx - maliang - Cursor:
mapped: 1
hidden: 0
at: 1285,37
size: 1268,1396
workspace: 1 (1)
floating: 0
pseudo: 0
monitor: 0
class: Cursor
title: AuthContext.tsx - maliang - Cursor
initialClass: Cursor
initialTitle: Cursor
pid: 2134
xwayland: 1
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 1
inhibitingIdle: 0

Window 5b8262da3070 -> 韧途 - HelloWorld - Obsidian v1.8.7:
mapped: 1
hidden: 0
at: 1285,37
size: 1268,1396
workspace: 4 (4)
floating: 0
pseudo: 0
monitor: 0
class: obsidian
title: 韧途 - HelloWorld - Obsidian v1.8.7
initialClass: obsidian
initialTitle: Obsidian
pid: 3197
xwayland: 1
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 4
inhibitingIdle: 0

Window 5b8260a2cc70 -> work:1:zsh - "archlinux-david" :
mapped: 1
hidden: 0
at: 7,37
size: 2546,1396
workspace: 3 (3)
floating: 0
pseudo: 0
monitor: 0
class: kitty
title: work:1:zsh - "archlinux-david"
initialClass: kitty
initialTitle: kitty
pid: 6958
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 2
inhibitingIdle: 0

Window 5b8260a40410 -> dotfiles:1:zsh - "" :
mapped: 1
hidden: 0
at: 7,37
size: 1268,1396
workspace: 1 (1)
floating: 0
pseudo: 0
monitor: 0
class: kitty
title: dotfiles:1:zsh - ""
initialClass: kitty
initialTitle: kitty
pid: 29468
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 0
inhibitingIdle: 0

@DamagedDingo
Copy link

DamagedDingo commented Feb 24, 2025

Try this.
class:^([Cc]hromium)$

There are some good regex examples from this guys repo.
https://github.com/JaKooLit/Hyprland-Dots/blob/main/config/hypr/UserConfigs/WindowRules.conf

@liiil825
Copy link
Author

Try this. class:^([Cc]hromium)$

There are some good regex examples from this guys repo. https://github.com/JaKooLit/Hyprland-Dots/blob/main/config/hypr/UserConfigs/WindowRules.conf

Thank you for your help, It works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants