Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

crashing randomly on hyprland

Open ghost opened this issue 2 years ago • 14 comments
trafficstars

hi, at some random point, i cant quite make out what causes it, waybar just crashes.

this is what the terminal spits out at me whenever it does:

[2023-08-26 15:35:24.941] [error] memory: Can't open /proc/meminfo
[2023-08-26 15:35:24.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:35:34.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:35:44.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:35:54.941] [error] memory: Can't open /proc/meminfo
[2023-08-26 15:35:54.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:04.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:14.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:24.941] [error] memory: Can't open /proc/meminfo
[2023-08-26 15:36:24.970] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:34.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:44.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:36:54.941] [error] memory: Can't open /proc/meminfo
[2023-08-26 15:36:54.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:37:04.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:37:14.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:37:24.941] [error] memory: Can't open /proc/meminfo
[2023-08-26 15:37:24.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:37:32.426] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:34.708] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:34.971] [error] cpu: Can't open /proc/stat
[2023-08-26 15:37:36.145] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:36.148] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:36.243] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:41.370] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:41.972] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:41.987] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:42.977] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:42.980] [error] Hyprland IPC: Couldn't open a socket (1)
[2023-08-26 15:37:44.971] [error] cpu: Can't open /proc/stat
Gdk-Message: 15:37:50.743: Error reading events from display: Invalid argument

ghost avatar Aug 26 '23 14:08 ghost

  1. What's your config?
  2. What version of Waybar are you using?
  3. How are you starting waybar?

zjeffer avatar Aug 26 '23 14:08 zjeffer

I have got the same problem.

[2023-08-26 20:31:51.226] [error] Hyprland IPC: Couldn't write (4)
waybar: ../waybar-hyprland-git/src/modules/hyprland/window.cpp:106: waybar::modules::hyprland::Window::Workspace waybar::modules::hyprland::Window::getActiveWorkspace(const std::string&): Assertion `workspaces.isArray()' failed.
[1]    24250 IOT instruction (core dumped)  waybar
  1. Config: waybar_config.zip
  2. Waybar version: Waybar v0.9.22-9-gb7a527b1 (branch 'master')
  3. normally during startup (the line from my hyprland.conf exec-once = waybar & nextcloud). However after the first crash is tarted it in the terminal with the command waybar. The log entry above is from this terminal

I'm sadly also not sure, what happened to cause this issue. It appeared three times already, if I see a pattern, I will report.

Maybe one Idea, it could correlate to an update of hyprland that I did a few days ago. @qube-03 what Hyprland version do you use? I'm running 0.28.0-1 if I'm not mistaken.

jdohm avatar Aug 26 '23 18:08 jdohm

config: https://notebin.de/?ad359dbf9d7316bd#CUQPViUcodbaFYVoo63FmnEXScgqgFRkySZSWfCKo5xt version: Waybar v0.9.20 how i start it: in my hyprland configuration with exec-once = waybar -c /home/qube/.config/waybar/config

my hyprland version is 0.28.0-1 from artix world repository

ghost avatar Aug 26 '23 19:08 ghost

I don't know why, but it crashes a lot while I use DigiKam and not as much (maybe even never, not sure) when surfing in firefox (even though DigiKam was open on another Desktop)

jdohm avatar Aug 26 '23 20:08 jdohm

@qube-03 for me it seems this issue was resolved by upgrading hyprland to version 0.29.0-1 does it still crash on your side? and if so, did you upgrade to 0.29.0-1 already?

Sadly just crashed again while working in FreeCad

[2023-09-09 21:40:31.610] [error] Hyprland IPC: Couldn't write (4)
waybar: ../waybar-hyprland-git/src/modules/hyprland/window.cpp:139: void waybar::modules::hyprland::Window::queryActiveWorkspace(): Assertion `clients.isArray()' failed.
[1]    9634 IOT instruction (core dumped)  waybar

jdohm avatar Sep 02 '23 21:09 jdohm

Using Hyprland on Artix. Waybar v0.9.22 and Hyprland 0.29.1-1 installed from Artix repo (so built without systemd). Waybar crashes quite randomly, been going on for a few weeks or so, almost always when laptop wakes again after sleep:

[2023-09-23 14:42:29.773] [error] Hyprland IPC: Couldn't write (4)
waybar: ../src/modules/hyprland/window.cpp:106: waybar::modules::hyprland::Window::Workspace waybar::modules::hyprland::Window::getActiveWorkspace(const std::string&): Assertion `workspaces.isArray()' failed.
zsh: IOT instruction  waybar

Starting it via exec-once in a script, the relevant bit:

  pgrep -x waybar > /dev/null || { waybar & }

waybar config quite messy, but it happens with default config as well. I don't think it's a config issue:

{
    "layer": "top", // Waybar at top layer
    "height": 31, // Waybar height (to be removed for auto height)
    "spacing": 4, // Gaps between modules
    // Choose the order of the modules
    "modules-left": ["hyprland/workspaces", "hyprland/window"],
    "modules-center": ["clock"],
    "modules-right": ["weatherbar", "pulseaudio", "network", "backlight", "keyboard-state", "battery", "battery#bat2", "tray"],
    // Modules configuration
    "hyprland/window": {
    "format": "{}",
    "separate-outputs": true
},
    "hyprland/workspaces": {
        "disable-scroll": true,
        "all-outputs": true,
        "format": "{name}: {icon}",
        "format-icons": {
            "1": "",
            "2": "",
            "3": "",
            "8": "",
            "urgent": "",
            "focused": "",
            "default": ""
        }
    },
    "keyboard-state": {
        "numlock": false,
        "capslock": false,
        "format": "{name} {icon}",
        "format-icons": {
            "locked": "",
            "unlocked": ""
        }
    },
    "hyprland/mode": {
        "format": "<span style=\"italic\">{}</span>"
    },
    "hyprland/scratchpad": {
        "format": "{icon} {count}",
        "show-empty": false,
        "format-icons": ["", ""],
        "tooltip": true,
        "tooltip-format": "{app}: {title}"
    },
    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        }
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10
    },
    "clock": {
        // "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
        "format": "{:%H:%M  |  %a %d %B}"
        // "format-alt": "{:%Y-%m-%d}"
    },
    "cpu": {
        "format": "{usage}% ",
        "tooltip": false
    },
    "memory": {
        "format": "{}% "
    },
    "temperature": {
        // "thermal-zone": 2,
        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
        "critical-threshold": 80,
        // "format-critical": "{temperatureC}°C {icon}",
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "format-icons": ["", "", "", "", "", "", "", "", ""]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
        "bat": "BAT2"
    },
    "network": {
        // "interface": "wlp2*", // (Optional) To force the use of this interface
        "format-wifi": "{essid} ({signalStrength}%) ",
        "format-ethernet": "{ipaddr}/{cidr} ",
        "tooltip-format": "{ifname} via {gwaddr} ",
        "format-linked": "{ifname} (No IP) ",
        "format-disconnected": "Disconnected ⚠",
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "on-click": "pavucontrol"
    },
    "custom/media": {
        "format": "{icon} {}",
        "return-type": "json",
        "max-length": 40,
        "format-icons": {
            "spotify": "",
            "default": "🎜"
        },
        "escape": true,
        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
        // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
    }
}

145818 avatar Sep 23 '23 12:09 145818

Temporary workaround is to start waybar like this:

#!/usr/bin/env bash

until waybar; do
    echo "Waybar crashed with exit code $?.  Respawning..." >&2
done

145818 avatar Sep 23 '23 18:09 145818

I have the exact same issue (same error message when crashing; workspaces.isArray). waybar 0.9.22-1, hyprland 0.29.1-1 on arch linux 6.5.4-zen2-1-zen . Happens sporadically every few hours when using librewolf or brave together with ferdium, Thunderbird, Firefox and kitty (I always have these applications open in parallel). I'm starting it either through hyprland (exec-once waybar) or afterwards directly through bemenu or kitty/zsh, always the same behavior. This is my config, in case it is useful:

{
    "layer": "top", // Waybar at top layer
    // "position": "bottom", // Waybar position (top|bottom|left|right)
    "height": 30, // Waybar height (to be removed for auto height)
    // "width": 1280, // Waybar width
    // Choose the order of the modules
    "modules-left": ["sway/workspaces", "hyprland/workspaces", "sway/mode", "custom/media", "temperature", "backlight"],
    "modules-center": ["sway/window", "hyprland/window"],
    "modules-right": ["pulseaudio", "network", "battery", "battery#bat2", "clock",
    "custom/weather", "tray", "custom/notification"],
    //"modules-right": ["mpd", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "clock", "tray"],
    // Modules configuration
    // "sway/workspaces": {
    //     "disable-scroll": true,
    //     "all-outputs": true,
    //     "format": "{name}: {icon}",
    //     "format-icons": {
    //         "1": "",
    //         "2": "",
    //         "3": "",
    //         "4": "",
    //         "5": "",
    //         "urgent": "",
    //         "focused": "",
    //         "default": ""
    //     }
    // },
    "sway/mode": {
        "format": "<span style=\"italic\">{}</span>"
    },
    "mpd": {
        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
        "format-disconnected": "",
        "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
        "unknown-tag": "N/A",
        "interval": 2,
        "consume-icons": {
            "on": " "
        },
        "random-icons": {
            "off": "<span color=\"#f53c3c\"></span> ",
            "on": " "
        },
        "repeat-icons": {
            "on": " "
        },
        "single-icons": {
            "on": "1 "
        },
        "state-icons": {
            "paused": "",
            "playing": ""
        },
        "tooltip-format": "MPD (connected)",
        "tooltip-format-disconnected": "MPD (disconnected)"
    },
    "idle_inhibitor": {
        "format": "{icon}",
        "format-icons": {
            "activated": "",
            "deactivated": ""
        }
    },
    "wlr/workspaces": {
        "disable-scroll": false,
        "on-click": "activate",
        "format": "{icon}",
        "on-scroll-up": "hyprctl dispatch workspace e+1",
        "on-scroll-down": "hyprctl dispatch workspace e-1"
    },
    "hyprland/window": {
        "max-length": 200,
        "separate-outputs": true
    },
    "tray": {
     //   "icon-size": 21,
        "spacing": 10,
        "show-passive-items": true,
    },
    "clock": {
        // "timezone": "America/New_York",
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        "format-alt": "{:%Y-%m-%d}"
    },
    "cpu": {
        "format": "{usage}% ",
        "tooltip": true
    },
    "memory": {
        "format": "{}% "
    },
    "temperature": {
        // "thermal-zone": 2,
        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
        "critical-threshold": 80,
        // "format-critical": "{temperatureC}°C {icon}",
        "format": "{temperatureC}°C {icon}",
        "format-icons": ["", "", ""]
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "format-icons": ["", ""]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "bat": "BAT0",
        "format": "{capacity}% {icon}",
        "format-charging": "{capacity}% ",
        "format-plugged": "{capacity}% ",
        "format-alt": "{time} {icon}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": ["", "", "", "", ""]
    },
    "battery#bat2": {
        "bat": "BAT2"
        //"format-alt": "{time} {icon}",
        //"exec": "upower -i `upower -e | grep 'BAT'` | grep "time to empty" | awk '{print substr($4, 1, length($4))}'"
    },
    "custom/notification": {
        "tooltip": false,
        "format": "{icon}",
        "format-icons": {
//            "notification": "<span foreground='red'><sup></sup></span>",
            "notification": "",
            "none": "",
            "dnd-notification": "<span foreground='red'><sup></sup></span>",
            "dnd-none": ""
        },
        "return-type": "json",
        "exec-if": "which swaync-client",
        "exec": "swaync-client -swb",
        "on-click": "swaync-client -t -sw",
        "on-click-right": "swaync-client -d -sw",
        "escape": true
    },
    "custom/weather": {
        "format": "{}",
        "format-alt": "{alt}",
        "format-alt-click": "click-left",
        "interval": 1800,
        "return-type": "json",
        "exec": "~/.config/waybar/scripts/weather_module.sh",
        "exec-if": "ping openweathermap.org -c1",
        "signal": 8
    },
    "network": {
        // "interface": "wlp2*", // (Optional) To force the use of this interface
        "format-wifi": "{essid} ({signalStrength}%) ",
        "format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
        "format-linked": "{ifname} (No IP) ",
        "format-disconnected": "Disconnected ⚠",
        "format-alt": "{ifname}: {ipaddr}/{cidr}"
    },
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", "", ""]
        },
        "on-click": "pavucontrol"
    },
    "custom/media": {
        "format": "{icon} {}",
        "return-type": "json",
        "max-length": 40,
        "format-icons": {
            "spotify": "",
            "default": "🎜"
        },
        "escape": true,
        "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
        // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
    }
}

michalke-it avatar Sep 25 '23 12:09 michalke-it

@145818 Do you still have this issue? I'm using artix on my laptop and its working perfectly.

xrtxn avatar Nov 25 '23 08:11 xrtxn

@145818 Do you still have this issue? I'm using artix on my laptop and its working perfectly.

For other reasons than this I switched to sway and is using their default bar so I don't know if it's still an issue or not. From my side this can be closed if nobody else is experiencing this.

145818 avatar Nov 25 '23 08:11 145818

Hello guys, I have same problem on my laptop. I got this error message randomly. [error] Hyprland IPC: Couldn't write (4) waybar: ../waybar-hyprland-git/src/modules/hyprland/window.cpp:138: void waybar::modules::hyprland::Window::queryActiveWorkspace(): Assertion `clients.isArray()' failed.

Any idea?

gberenyi avatar Dec 28 '23 14:12 gberenyi

@gberenyi Can you post your waybar config?

zjeffer avatar Dec 28 '23 15:12 zjeffer

I've been getting the same error as well.

[2024-03-14 01:40:54.864] [error] Hyprland IPC: Couldn't write (4)
[2024-03-14 01:58:32.785] [error] Hyprland IPC: Couldn't write (4)
waybar: ../src/modules/hyprland/window.cpp:138: void waybar::modules::hyprland::Window::queryActiveWorkspace(): Assertion `clients.isArray()' failed.

I haven't gotten this on my desktop, only my laptop. I wonder if this some kind of performance or timeout issue.

Here is my config:

{
  "height": 25,
  "layer": "top",
  "modules-left": [
    "sway/workspaces",
    "hyprland/workspaces",
    "sway/mode",
    "hyprland/submap",
    "custom/media",
    "sway/window",
    "hyprland/window"
  ],
  "modules-center": [
    "clock",
    "custom/notification"
  ],
  "modules-right": [
    "custom/nvchecker",
    // "custom/checkupdates",
    "idle_inhibitor",
    "pulseaudio",
    "network",
    "cpu",
    "memory",
    "temperature",
    "backlight",
    "battery",
    "tray"
  ],
  "sway/workspaces": {
    "format": "{name}"
  },
  "wlr/workspaces": {
    "format": "{icon}",
    "format-icons": {
      "1": "一",
      "2": "二",
      "3": "三",
      "4": "四",
      "5": "五",
      "6": "六",
      "7": "七",
      "8": "八",
      "9": "九",
      "10": "十",
      "11": "-",
      "12": "="
    },
    "sort-by-number": true,
    "on-click": "activate"
  },
  "hyprland/workspaces": {
    "format": "{icon}",
    "format-icons": {
      "1": "一",
      "2": "二",
      "3": "三",
      "4": "四",
      "5": "五",
      "6": "六",
      "7": "七",
      "8": "八",
      "9": "九",
      "10": "十",
      "11": "-",
      "12": "="
    },
    "sort-by-number": true,
    "on-click": "activate",
    "on-scroll-up": "hyprctl dispatch workspace m+1",
    "on-scroll-down": "hyprctl dispatch workspace m-1"
  },
  "sway/mode": {
    "format": "<span style=\"italic\">{}</span>"
  },
  "sway/window": {
    "format": " {}",
    "rewrite": {
      "(.*) - YouTube — Mozilla Firefox$": "   $1",
      // "^YouTube — Mozilla Firefox$": "   $1",
      "(.*) — Mozilla Firefox$": "  $1",
      "^Mozilla Firefox$": "",
      "(.*) — Tor Browser$": "🌐 $1",
      "^Tor Browser$": "🌐",
      "(.*) - Chromium$": "  $1",
      "^Zoom Meeting$": " ",
      "(.*) - vim": " $1",
      "(.*) - zsh": " [$1]"
    }
  },
  "hyprland/window": {
    "format": " {}",
    "rewrite": {
      "(.*) - YouTube — Mozilla Firefox$": "   $1",
      // "^YouTube — Mozilla Firefox$": "   $1",
      "(.*) — Mozilla Firefox$": "  $1",
      "^Mozilla Firefox$": "",
      "(.*) — Tor Browser$": "🌐 $1",
      "^Tor Browser$": "🌐",
      "(.*) - Chromium$": "  $1",
      "^Zoom Meeting$": " ",
      "(.*) - vim": " $1",
      "(.*) - zsh": " [$1]"
    }
  },
  "mpd": {
    "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ ",
    "format-disconnected": "Disconnected ",
    "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
    "unknown-tag": "N/A",
    "interval": 2,
    "consume-icons": {
      "on": " "
    },
    "random-icons": {
      "off": "<span color=\"#f53c3c\"></span> ",
      "on": " "
    },
    "repeat-icons": {
      "on": " "
    },
    "single-icons": {
      "on": "1 "
    },
    "state-icons": {
      "paused": "",
      "playing": ""
    },
    "tooltip-format": "MPD (connected)",
    "tooltip-format-disconnected": "MPD (disconnected)"
  },
  "custom/checkupdates": {
    "exec-on-event": false,
    "interval": 60,
    "exec": "wc -l /tmp/checkupdates-systemd /tmp/checkupdates-aur-systemd /tmp/aurutils-systemd | tail -n1 | awk '{print $1}'",
    "on-click": "notify-send -t 5000 Repos \"$(rg -v 'haskell|kodi|texlive|perl' /tmp/checkupdates-systemd)$([ -n \"$(rg haskell /tmp/checkupdates-systemd)\" ] && echo \"\nhaskell stuff\")$([ -n \"$(rg kodi /tmp/checkupdates-systemd)\" ] && echo \"\nkodi stuff\")$([ -n \"$(rg texlive /tmp/checkupdates-systemd)\" ] && echo \"\ntexlive stuff\")$([ -n \"$(rg perl /tmp/checkupdates-systemd)\" ] && echo \"\nperl stuff\")\" & notify-send -t 5000 AUR \"$(cat /tmp/aurutils-systemd)\"& notify-send -t 5000 PARU \"$(cat /tmp/checkupdates-aur-systemd)\"&",
    "on-click-right": "alacritty --hold -e ~/.scripts/updateAUR",
    "on-click-middle": "alacritty --hold -e sudo pacmatic -Syu",
    "format": " Repo: {}"
  },
  "custom/nvchecker": {
    "exec-on-event": false,
    "interval": 60,
    "exec": "nvcmp 2> /dev/null | wc -l",
    "on-click": "notify-send \"New Version Checker\" \"$(nvcmp)\"",
    "format": " Nv: {}"
  },
  "custom/notification": {
    "tooltip": false,
    "format": "{icon}",
    "format-icons": {
      "notification": "<span foreground='red'><sup></sup></span>",
      "none": "",
      "dnd-notification": "<span foreground='red'><sup></sup></span>",
      "dnd-none": ""
    },
    "return-type": "json",
    "exec-if": "command -V swaync-client",
    "exec": "swaync-client -swb",
    "on-click": "swaync-client -t -sw",
    "on-click-right": "swaync-client -d -sw",
    "escape": true
  },
  "idle_inhibitor": {
    "format": "{icon}",
    "format-icons": {
      "activated": "",
      "deactivated": ""
    }
  },
  "tray": {
    // "icon-size": 21,
    "spacing": 10
  },
  "clock": {
    "interval": 1,
    "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
    "format": "{:%H:%M:%S}",
    // "format": "{:%X}",
    "format-alt": "{:%Y-%m-%d}"
  },
  "cpu": {
    "interval": 1,
    "format": "{usage}% ",
    "tooltip": false
  },
  "memory": {
    "interval": 1,
    "format": "{}% "
  },
  "temperature": {
    "interval": 1,
    "hwmon-path": "/tmp/hwmon-path",
    "critical-threshold": 80,
    // "format-critical": "{temperatureC}°C {icon}",
    "format": "{temperatureC}°C {icon}",
    "format-icons": [
      "",
      "",
      ""
    ]
  },
  "backlight": {
    // "device": "acpi_video1",
    "format": "{percent}% {icon}",
    "format-icons": [
      "",
      ""
    ],
    "on-scroll-up": "light -U 5",
    "on-scroll-down": "light -A 5"
  },
  "battery": {
    "states": {
      // "good": 95,
      "warning": 30,
      "critical": 15
    },
    "format": "{capacity}% {icon}",
    "format-charging": "{capacity}% ",
    "format-plugged": "{capacity}% ",
    "format-alt": "{time} {icon}",
    // "format-good": "", // An empty format will hide the module
    // "format-full": "",
    "format-icons": [
      "",
      "",
      "",
      "",
      ""
    ]
  },
  "battery#bat2": {
    "bat": "BAT2"
  },
  "network": {
    // "interface": "wlp2*", // (Optional) To force the use of this interface
    "format-wifi": "{essid} ({signalStrength}%) ",
    "format-ethernet": "{ifname}: {ipaddr}/{cidr} ",
    "format-linked": "{ifname} (No IP) ",
    "format-disconnected": "Disconnected ⚠",
    "format-alt": "{ifname}: {ipaddr}/{cidr}"
  },
  "pulseaudio": {
    // "scroll-step": 1, // %, can be a float
    "format": "{volume}% {icon} {format_source}",
    "format-bluetooth": "{volume}% {icon} {format_source}",
    "format-bluetooth-muted": " {icon} {format_source}",
    "format-muted": " {format_source}",
    "format-source": "{volume}% ",
    "format-source-muted": "",
    "format-icons": {
      "headphone": "",
      "hands-free": "",
      "headset": "",
      "phone": "",
      "portable": "",
      "car": "",
      "default": [
        "",
        "",
        ""
      ]
    },
    "on-click": "pavucontrol",
    "on-click-right": "qpwgraph",
    "on-click-middle": "easyeffects"
  },
  "custom/media": {
    "format": "{icon} {}",
    "return-type": "json",
    "max-length": 40,
    "format-icons": {
      "spotify": "",
      "default": "🎜"
    },
    "escape": true,
    "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
    // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
  }
}
// vim:ft=jsonc

and my css:

@import "/etc/xdg/waybar/style.css" /* layer(default) */;

* {
    /* `otf-font-awesome` is required to be installed for icons */
    font-family: "Quicksand", "Ubuntu Condensed", "Font Awesome 6 Free", "Font Awesome 6 Brands", "IPAexGothic", Helvetica, Arial, sans-serif;
}

window#waybar {
    background-color: rgba(0, 0, 0, 0.7);
}

#workspaces button.active {
    background-color: #64727D;
    box-shadow: inset 0 -3px #ffffff;
}

CobaltSpace avatar Mar 15 '24 04:03 CobaltSpace

I can confirm that I am still getting this error, it happens most often when the overall CPU usage on the machine is very high.

Atrate avatar Apr 03 '24 08:04 Atrate

Might be fixed with https://github.com/Alexays/Waybar/pull/3215

Alexays avatar May 06 '24 09:05 Alexays

Unfortunately, issue is not resolved.

[2024-05-15 21:01:06.013] [info] Bar configured (width: 1920, height: 30) for output: HDMI-A-1
[2024-05-15 21:57:06.138] [error] Hyprland IPC: Couldn't write (4)
terminate called after throwing an instance of 'std::runtime_error'
  what():  Error parsing JSON: * Line 1, Column 1
  Syntax error: value, object or array expected.

config file attached. config.gz

jason-oliveira avatar May 16 '24 03:05 jason-oliveira

Can confirm, still occurs.

Hyprland IPC: Couldn't write (4)

Related part of the config:

"hyprland/window": {
    "format": "{}",
    "rewrite": {
        "(.*)Librewolf(.*)": " ",
        "(.*)Steam(.*)": "steam",
        "(.*) - kitty": "> [$1]",
        "(.*) - Thunar": "$1",
        "(.*) - (.*) - (.*) - VSCodium": "$1[$2]",
        "(.*) - VSCodium": "$1",
        "(.*)Discord(.*)": "discord"
    },
    "separate-outputs": true
},

413x1nkp avatar Jun 20 '24 06:06 413x1nkp