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

hyprland/workspaces: clarification on window-rewrite precedence #3987

Open
MartinLoeper opened this issue Mar 17, 2025 · 1 comment
Open

Comments

@MartinLoeper
Copy link

I configured the following rules for the hyprland workspaces module.
I want some rules like the Chrome one to have precedence but currently the neovim rules always take precedence.
Could someone please explain why and how to structure these properly?

"window-rewrite" = {
  # note: these fuzzy rules should have least priority
  "title<.*nvim.*>" = "";
  "title<.*(- n ).*>" = "";
  "title<(.*[$%#] *)?([hb]|nv)top.*>" = "";
  "title<.*Zellij.*>" = "";
  "title<Signal>" = "󰍡";
  "title<WhatsApp.*>" = "";
  "title<.[0-9]+. WhatsApp.*>" = "°";
  "title<(.* - )?(.[0-9]+. )?YouTube.*>" = "";
  "title<.* - Gmail .*>" = "󰊫";
  "title<Winetricks.*>" = "󰡶";
  
  "class<Pcmanfm>" = "";
  "class<com.github.weclaw1.ImageRoll|nomacs>" = "";
  "class<firefox>" = "";
  "class<obsidian>" = "󱞁";
  "class<ONLYOFFICE Desktop Editors>" = "󰈙";
  "class<calibre-.*>" = "";
  "class<org.qbittorrent.qBittorrent>" = "";
  "class<org.kde.kdeconnect.*>" = "";
  "class<mpv>" = "";
  "class<vlc>" = "󰕼";
  "class<Gimp-.*>" = "";
  "class<steam.*>" = "󰓓";
  "class<steam> title<Friends List>" = "";
  "class<steam_app_[0-9]+>" = "󰮂";
  "class<lutris>" = "🦦";
  "class<Spotify>" = "";
  "class<jetbrains-idea(-ce)?>" = "";
  "class<Code>" = "󰨞";
  "class<code-insiders>" = "󰨞";
  "class<com.obsproject.Studio|zoom>" = "";
  "class<io.github.whoozle.android-file-transfer>" = "";
  "class<teams-for-linux>" = "󰊻";
  "class<discord>" = "";
  "class<legcord>" = "";
  "class<MongoDB Compass>" = "";
  "class<org.keepassxc.KeePassXC>" = "";
  "class<mingo>" = "";
  "class<thunderbird>" = "";
  "class<org.wezfurlong.wezterm>" = "";
  "class<com.mitchellh.ghostty>" = "";
  "class<Postman>" = "";
  "class<(Chromium)|(Chrome)>" = "";
};
@Aron22563
Copy link

Aron22563 commented Mar 18, 2025

Quick Explanation

The rewrite rules are as far as i know just rules to add icons for specific applications next to your workspace numbers. Those icons get assigned to the applications based on one of 4 rules:

Config Naming Categry
something Vague
class<something> Class-only
title<something> Title only
class<something> title<something2> Hybrid

Idea of what might work

They are not read in any specific order of how they appear in the config but from top to bottom within your "window-rewrite"={ ... };

Line 1: "title<.*nvim.*>" = "";
Line 43: "class<(Chromium)|(Chrome)>" = "";

You could try exchanging the block of applications searched for by their class<> with the ones searched for by title<>.

What could help understanding your issue better

  • xprop to find out WM_CLASS (string) of both the apps you want to have preceding eachother.
  • your entire config or config.jsonc whereever you add the entire module configuration.
  • what steps of resorting the icons you have tried and whether your changes generally made an effect on their sorting

Wiki i found that could help:
Workspace Configuration
Waybar Hyprland Window

Hope this helps! If you have any questions or need further help, feel free to ask :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants