Waybar: High CPU usage

The CPU usage of waybar slowly increases over time until it takes up 100% of one of my cores. The rate of increase is fairly steady at ~0.04% per minute. This started fairly recently, say within the last month or so. I’ve tested with 0.9.2, 0.9.3, and the most recent git commit and the issue is present with all of them. I don’t think this was happening when 0.9.2 was the stable release, so it may be related to a dependency. I’m running an up-to-date Arch Linux with sway v1.5. I’ve attached log output from both sway and waybar as well as my config for waybar. The logs run until waybar reaches 10% CPU usage (up from an inital 0.21%) at which point I killed the process. I’m not sure whether this is relevant, but I run an i3 session in another virtual terminal. I spend most of my time there, only switching to sway when I want to watch video without tearing.

{
    "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",
        "sway/mode",
        "custom/media"
    ],
    "modules-center": [],
    "modules-right": [
        "network",
        "backlight",
        "pulseaudio",
        "battery",
        "clock",
        "tray"
    ],
    "sway/workspaces": {
        "disable-scroll": true,
        "all-outputs": true,
        "format": "{name}: {icon}",
        "format-icons": {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": "調",
            "urgent": "",
            "focused": "",
            "default": ""
        }
    },
    "mpd": {
        "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
        "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)"
    },
    "tray": {
        // "icon-size": 21,
        "spacing": 10
    },
    "clock": {
        "format": "{:%I:%M %p}",
        "tooltip-format": "{:%Y-%m-%d | %I:%M %p}",
        "format-alt": "{:%Y-%m-%d}"
    },
    "backlight": {
        // "device": "acpi_video1",
        "format": "{percent}% {icon}",
        "on-scroll-up": "pkexec brillo -A 5",
        "on-scroll-down": "pkexec brillo -U 5",
        "smooth-scrolling-threshold": 3,
        "format-icons": [
            "",
            ""
        ]
    },
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "bat": "BAT0",
        "adapter": "ADP1",
        "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": [
            "",
            "",
            "",
            "",
            ""
        ]
    },
    "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": 5, // %, can be a float
        "smooth-scrolling-threshold": 3,
        "format": "{volume}% {icon} {format_source}",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "",
        "format-source-muted": "",
        "format-icons": {
            "default": [
                "",
                "",
                ""
            ]
        },
        "on-click": "pavucontrol"
    }
}

sway.log waybar.log

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 17

Most upvoted comments

The new problem was https://github.com/Alexays/Waybar/issues/2631, fixed in 0.9.24-1

EDIT: not a waybar developer, but it’s in the release notes

I think a new bug is occurring, as I faced the same issue again today, after an upgrade (latest from archlinux).