hyprland-autoname-workspaces: [BUG] Changes in workspace names no longer reflected in waybar when using "hyprland/workspaces"

Describe the bug Waybar has recently merged the "hyprland/workspaces" module into the new release, and as of my experiment with hyprland version 0.29.1, the old "wlr/workspaces" module no longer works for hyprland on waybar, so I will be forced to switch to the hyprland workspaces module when I eventually upgrade my local hyprland.

When using the new hyprland workspaces module, the workspace name is no longer dynamically updated when a new window is opened or closed, even though when I run waybar --log-level trace Hyprland IPC is still sending the correct event including the updated workspace names.

image

The updates are only reflected when I manually reload waybar (i.e. pkill waybar && hyprctl dispatch exec waybar).

This could be a bug with the hyprland/workspaces module, please let me know how I can raise an issue there, including what specifically needs to be implemented, etc. Many thanks!

Program version?

hyprland-autoname-workspaces 1.1.7

Program configuration dump? (ideally)

  • Run hyprland-autoname-workspaces --dump
{
  "version": "1.1.7",
  "class": {
    "(?i)bluetooth": "",
    "(?i)control": "",
    "(?i)zathura": "",
    "(?i)kitty": "",
    "(?i)calibre": "",
    "(?i)[ck]alculator": "",
    "(?i)FFPWA": "",
    "(?i)dolphin": "",
    "(?i)Zoom": "",
    "(?i)chrom.*": "",
    "(?i)explorer.exe": "󰍲",
    "(?i)edit": "",
    "[Ss]team": "",
    "[(thunder)(Thunder)(better)(Better)]bird": "",
    "(?i)slack": "󰒱",
    "(?i)xournal": "󱞂",
    "(?i)wechat": "",
    "(?i)wine.*": "󰍲",
    "(?i)plan": "",
    "(?i)firefox": "",
    "Spotify": "",
    "DEFAULT": "",
    "(?i)settings": "",
    "(?i)config": "",
    "com.obsproject*": "<span foreground='#DD0000'>󰻂</span>"
  },
  "class_active": {
    "[Ff]irefox": "<span foreground='#d64000'></span>"
  },
  "initial_class": {},
  "initial_class_active": {},
  "workspaces_name": {},
  "title_in_class": {
    "(?i)explorer.exe": {
      "(?i)wechat": ""
    },
    "(?i)firefox": {
      "(?i)youtube": " ꟳ",
      "(?i)spotify": " ꟳ",
      "(?i)github": " ꟳ"
    },
    "(?i)FFPWA": {
      "(?i)[Oo]utlook": "󰴢",
      "(?i)[Yy]outube": "",
      "(?i)WhatsApp": "",
      "(?i)[Tt]eams": ""
    },
    "[(thunder)(Thunder)(better)(Better)]bird": {
      "(?i)Task": ""
    },
    "(?i)kitty": {
      "(?i)vim": "",
      "(?i)top": ""
    }
  },
  "title_in_class_active": {
    "(?i)kitty": {
      "(?i)vim": "<span foreground='#427b58'></span>",
      "(?i)top": "<span foreground='#9d0006'></span>"
    },
    "(?i)FFPWA": {
      "(?i)[Yy]outube": "",
      "(?i)[Tt]eams": "",
      "(?i)[Oo]utlook": "󰴢",
      "(?i)WhatsApp": "<span foreground='#25D366'></span>"
    },
    "(?i)firefox": {
      "(?i)youtube": "<span foreground='#FF0000'> </span>ꟳ",
      "(?i)spotify": "<span foreground='#1DB954'> </span>ꟳ",
      "(?i)github": " ꟳ"
    }
  },
  "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": {
    "": "^$",
    "[Ss]team": "^$",
    "(?i)fcitx": ".*",
    "(?i)TestApp": ""
  },
  "format": {
    "dedup": true,
    "dedup_inactive_fullscreen": true,
    "delim": " ",
    "workspace": "{id} {clients}",
    "workspace_empty": "{id}",
    "client": "{icon}{delim}",
    "client_fullscreen": "<span color='#8f3f71'>{icon}</span>",
    "client_active": "<span color='#458588'>{icon}</span>",
    "client_dup": "{client}{counter_sup}{delim}",
    "client_dup_active": "*{icon}*{delim}{icon}{counter_unfocused_sup}",
    "client_dup_fullscreen": "[{icon}]{delim}<>{icon}{counter_unfocused}{delim}"
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Update waybar to v0.9.22 or higher.
  2. Configure waybar to use the module “hyprland/workspaces” to display the workspaces.
  3. Launch waybar.
  4. Open/Close windows that should be reflected in the workspace name generated by hyplrand-autoname-workspaces.
  5. See error.

Expected behavior Workspace name generated by hyprland-autoname-workspaces correctly reflected on waybar.

Linux Distro (please complete the following information):

OS: Arch Linux x86_64 Kernel: 6.4.12-arch1-1 Hyprland: v0.29.0 Waybar: v0.9.22

edit: fixed typos

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

The change in waybar depends on the change made in hyprland, which was also done on the same day, so you actually need to compile both from latest code, sorry I forgot to mention it earlier!

Other than that, the default format of hyprland/workspaces is {id} and you need to change it to {name}, but since you see some names after waybar restart, I suppose you did it…

Hi I’ve just compiled both hyprland and waybar with the latest git master version. The good news is that the "renameworkspace" IPC event is now both correctly generated by hyprland IPC and handled by waybar, so if I run hyprctl dispatch renameworkspace 1 "xxx" the changes are correctly reflected on waybar. The bad news is, hyprland-autoname-workspaces itself stops working:

$ env RUST_BACKTRACE=full hyprland-autoname-workspaces
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SerdeError(Error("invalid value: integer `18446744073709551615`, expected i16", line: 12, column: 35))', src/renamer/mod.rs:278:34
stack backtrace:
   0:     0x560b6f524c51 - <unknown>
   1:     0x560b6f54c8ec - <unknown>
   2:     0x560b6f5219ce - <unknown>
   3:     0x560b6f524a65 - <unknown>
   4:     0x560b6f5261fa - <unknown>
   5:     0x560b6f525e93 - <unknown>
   6:     0x560b6f5267fb - <unknown>
   7:     0x560b6f5266f7 - <unknown>
   8:     0x560b6f5250b6 - <unknown>
   9:     0x560b6f526442 - <unknown>
  10:     0x560b6f334623 - <unknown>
  11:     0x560b6f334a83 - <unknown>
  12:     0x560b6f3447b4 - <unknown>
  13:     0x560b6f3704e2 - <unknown>
  14:     0x560b6f367453 - <unknown>
  15:     0x560b6f3713f9 - <unknown>
  16:     0x560b6f51be0b - <unknown>
  17:     0x560b6f370bf5 - <unknown>
  18:     0x7f29d6827cd0 - <unknown>
  19:     0x7f29d6827d8a - __libc_start_main
  20:     0x560b6f334d45 - <unknown>
  21:                0x0 - <unknown>

I just make a release, thanks you guys.

I make a fix but I will have to do a release of hyprland-rs, please be patient.

Sure, feel free to a quick PR for this or I will do when I can, thanks! edit: done

Other than that, the default format of hyprland/workspaces is {id} and you need to change it to {name}

@cyrinux I think this should be placed here, just to prevent questions…

The change in waybar depends on the change made in hyprland, which was also done on the same day, so you actually need to compile both from latest code, sorry I forgot to mention it earlier!

Other than that, the default format of hyprland/workspaces is {id} and you need to change it to {name}, but since you see some names after waybar restart, I suppose you did it…