Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

cannot switch from manual to automatic argument indexing

Open Sk7Str1p3 opened this issue 1 year ago • 7 comments

appeared at 0.10 and seem not being fixed in latest 0.11.0.

i have an custom AUR updates checker (aur package - waybar-updates) which returns json string, this style was working flawlessly untul i updated. i logs i found this: [2024-09-17 22:35:57.284] [error] custom/upd: cannot switch from manual to automatic argument indexing i already told about this issue but Alexays said he fixed this in 0.11 but he didnt.

waybar-updates output: {"text":"2","alt":"pending-updates","tooltip":"\t\t \t  2\n\nayugram-desktop-bin 5.4.1-1 -> 5.4.1-2\nyay 12.3.5-1 -> 12.4.1-1","class":"pending-updates"} module declaration: "custom/upd": { "format": "{icon}{}", "return-type": "json", "format-icons": { "updated": "" }, "exec-if": "which waybar-updates", "exec": "waybar-updates", "on-click": "kitty -e ~/.config/scripts/upd.sh" },

Sk7Str1p3 avatar Sep 17 '24 19:09 Sk7Str1p3

I had this error with custom/media, i had to change the format from

"custom/media": {
        "format": "{icon} {}",

to

"custom/media": {
        "format": "{0} {1}",

uwiwiow avatar Sep 18 '24 00:09 uwiwiow

Same here i have that issue also on my custom/notifications

And the error message as below

[error] custom/notifications: cannot switch from manual to automatic argument indexing

thyeun avatar Sep 18 '24 09:09 thyeun

For me putting {icon} at the end of format string seems to be a workaround

  "custom/updates": {
    "format": "<span foreground=\"orange\">{}</span>{icon}",
    "return-type": "json",
    "format-icons": {
      "updated": "Up to date",
      "pending-updates": "updates",
    },
    "exec-if": "which waybar-updates",
    "exec": "waybar-updates",
    "on-click": "alacritty -T yay -e yay -Syu &"
  },

ecorini avatar Sep 18 '24 20:09 ecorini

if your expectation is icon number than you can use {icon} {0}, and if your expectation is number icon than you should use {} {icon} for it.

Last time before the latest update, it can be use icon number as {icon} {}.

thyeun avatar Sep 19 '24 01:09 thyeun

Experiencing the same on Manjaro after the latest update. My affected setting was:

    "sway/language": {
        "format": "{flag} {}"
	},

Switching the format order to {} {flag} works.

esm7 avatar Oct 04 '24 12:10 esm7

if your expectation is icon number than you can use {icon} {0}, and if your expectation is number icon than you should use {} {icon} for it.

Last time before the latest update, it can be use icon number as {icon} {}.

Is this a bug, or a documentation issue? The manpage waybar-custom doesn't mention anything about being able to put a number inside the {}, and what it actually does.

BBaoVanC avatar Oct 16 '24 22:10 BBaoVanC

@BBaoVanC I'm not sure what happen to the latest version, but some how, {} with inside number 0 and 1 give different outcome, as per mentioned on my previous post.

If you are main contributor, pls kindly double check, what going on with the code in latest version.

thyeun avatar Oct 17 '24 02:10 thyeun