hyprland-community / hyprland-autoname-workspaces

Hyprland autoname workspaces 🪟 [maintainers=@cyrinux,@maximbaz]
ISC License
192 stars 8 forks source link

[BUG] Names not updating on window open/close #95

Open ghost opened 12 months ago

ghost commented 12 months ago

Describe the bug Workspace names are not properly updated on window open/close events (triggered by standard Hyprland keybinds). Old icons remain, new icons do not appear. The next event (workspace switch, third window opened, window focus switch, etc) eventually updates the names to their true values.

I am not sure if this bug should be filed against hyprland-workspaces instead. Please let me know and I will close ASAP. Thank you!

Program version? 1.1.5

Program configuration dump? (ideally)

{
  "version": "1.1.5",
  "class": {
    "[Cc]odium(.*)": "󰨞",
    "(?i)Alacritty": "",
    "[Ff]irefox": "󰈹",
    "[Mm]pv": "",
    "DEFAULT": "󰝤",
    "[Nn]autilus": ""
  },
  "class_active": {},
  "initial_class": {},
  "initial_class_active": {},
  "workspaces_name": {
    "8": "eight",
    "10": "ten",
    "1": "one",
    "0": "zero",
    "6": "six",
    "3": "three",
    "2": "two",
    "5": "five",
    "7": "seven",
    "4": "four",
    "9": "nine"
  },
  "title_in_class": {
    "(?i)Alacritty": {
      "(?i)neovim": "neovim"
    }
  },
  "title_in_class_active": {
    "(?i)firefox": {
      "(?i)twitch": "<span color='purple'>{icon}</span>"
    }
  },
  "title_in_initial_class": {},
  "title_in_initial_class_active": {},
  "initial_title_in_class": {},
  "initial_title_in_class_active": {},
  "initial_title_in_initial_class": {},
  "initial_title_in_initial_class_active": {},
  "exclude": {
    "aProgram": "^$",
    "(?i)TestApp": "",
    "(?i)fcitx": ".*",
    "": "^$",
    "[Ss]team": "^$"
  },
  "format": {
    "dedup": false,
    "dedup_inactive_fullscreen": false,
    "delim": " ",
    "workspace": "{clients}",
    "workspace_empty": "󰝣",
    "client": "{icon}",
    "client_fullscreen": "[{icon}]",
    "client_active": "{icon}",
    "client_dup": "{icon}{counter_sup}",
    "client_dup_active": "*{icon}*{delim}{icon}{counter_unfocused_sup}",
    "client_dup_fullscreen": "[{icon}]{delim}{icon}{counter_unfocused_sup}"
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Start hyprland-workspaces
  2. Start hyprland-autoname-workspaces
  3. Create more than one window
  4. Close a window
  5. The second window's icon remains until a new event (i.e. workspace switch) is triggered

Expected behavior Workspace names are updated when a window is opened/closed.

Linux Distro (please complete the following information): Fedora 38

Additional context Video clearly illustrating problem: https://files.catbox.moe/pwgsdf.mkv

cyrinux commented 12 months ago

Hi, thanks for the report, I will dig more asap 🌞 I will try to reproduce the bug.

maximbaz commented 10 months ago

This sounds like a race condition between two apps. Luckily hyprland has added a dedicated "renameworkspace" event today, so presumably if hyprland-workspaces adds it to the list of events it's interested in (https://github.com/FieldofClay/hyprland-workspaces/blob/a5843cc2c3d2e35ce07015e5185a2f694e33291e/src/main.rs#L150), then it would react when hyprland-autoname-workspaces renames a workspace, and you would see result with no delay.

Try to add it, and see if it solves the issue!

psimovec commented 10 months ago

I have the same issue, hyprland/workspaces doesn't catch any window name updates. (I was using wlr/workspaces which stopped working, and now on hyprland/workspaces the names don't update). Rename takes effect only every time i restart waybar.

cyrinux commented 10 months ago

@psimovec can you update autoname and hyprland (master/main) ?

psimovec commented 10 months ago

I will try.. But now I am thinking is it really hyprland-autoname-workspaces problem? Because when i check hyprctl clients the windows are updated correctly.. Just waybar or hyprland-workspaces module of waybar are not catching any name updates it and require waybar restart for update..

psimovec commented 10 months ago

Oh I see you were already solving it: https://github.com/hyprland-community/hyprland-autoname-workspaces/issues/98 .. What did you do to make it work again?

It's really weird.. I'm on latest hyprland (hyprland-git, checked that it is on last commit).. hyprland autoname workspaces on master, using cargo run..

I am even checking waybar with debug option and it keeps getting events which look fine like

[2023-09-18 14:13:34.065] [debug] hyprland IPC received renameworkspace>>1,<span letter_spacing='-9000'> </span><span font_size='70%' rise='4pt' color='#D1D1FF'>1 </span><span bgcolor='yellow' bgalpha='5%'><span color ="#7AF" > </span></span>  <span color ="#7AF" > </span><span color='white' letter_spacing='000' font_size='100%' weight='1000' rise='-1pt' font_features='rand'>x2 </span> <span color="orange"> </span> <span letter_spacing='-18000'> </span>

But waybar doesn't actually visually update the workspaces... update unless I restart the waybar..

EDIT: manual install of waybar fixed the issue for me as following comments mention, thanks!

maximbaz commented 10 months ago

Could you confirm if your waybar is also built from latest master? The latest release is too old, doesn't contain the necessary fix yet.

jontstaz commented 10 months ago

It's still not working for me FYI. I'm on Arch and I'm using the latest versions of waybar, hypr and hyprland-autoname-workspaces. I ensured to install the *-git versions of each package via AUR.

Is there any fix for this available yet or is one currently being worked on?

Thx,

EDIT: Ahhh nevermind, I just manually installed waybar from the latest master branch as was mentioned above and now it's working as expected!

noggynoggy commented 10 months ago

Unfortunately for me installing from the latest master does not fix the issue:

$ waybar --version
Waybar v0.9.22-69-g9b8adc1 (branch 'master')

$ hyprland-autoname-workspaces --version
hyprland-autoname-workspaces 1.1.11

Waybar takes the names of the workspaces when it's launched once, but does not update the names "at runtime". I'm unsure if that is a hyprland-autoname-workspacesissue or a waybar issue, because hyprctl workspaces shows that the workspaces are all appropriately named "at runtime".

maximbaz commented 10 months ago

Do you also run hyprland from latest master?

noggynoggy commented 10 months ago

No, I have to use the hyprland-nvidia 0.29.1-1

maximbaz commented 10 months ago

You need to either wait for the next release, or cherry-pick the necessary commit from the master branch: https://github.com/hyprwm/Hyprland/commit/2d100bf57e0c0184d307bd4173b1a8d9fc7130e1

noggynoggy commented 10 months ago

The hyperland-nvidia-git AUR package worked out for me! Thanks for the help

elythh commented 9 months ago

Has anyone been able to make it work using NixOS pkgs ?

cyrinux commented 9 months ago

Has anyone been able to make it work using NixOS pkgs ?

Hi, What do you mean? Can you give more detail ?

Brisingr05 commented 9 months ago

@elythh I'm using NixOS (nixos-unstable) and was facing this problem as well. I was able to solve it by using the Waybar package from nixpkgs-wayland.

Brisingr05 commented 7 months ago

Issue doesn't seem exist on my current system anymore:

$ waybar --version
Waybar v0.9.24

$ hyprland-autoname-workspaces --version
hyprland-autoname-workspaces 1.1.11

$ hyprctl version
Hyprland, built from branch  at commit v0.33.1  ().
Tag: 

flags: (if any)
debug

$ nixos-version
24.05.20231217.91a0070 (Uakari)