diff --git a/src/modules/hyprland/workspace.cpp b/src/modules/hyprland/workspace.cpp index ae66bc84..4da78ad1 100644 --- a/src/modules/hyprland/workspace.cpp +++ b/src/modules/hyprland/workspace.cpp @@ -270,13 +270,23 @@ void Workspace::update(const std::string &workspace_icon) { bool Workspace::isEmpty() const { auto ignore_list = m_workspaceManager.getIgnoredWindows(); - if (ignore_list.empty()) { - return m_windows == 0; + + // If there are no windows at all, the workspace is empty + if (m_windowMap.empty()) { + return true; } - // If there are windows but they are all ignored, consider the workspace empty + + // If no windows are ignored, any window means the workspace is not empty + if (ignore_list.empty()) { + return false; + } + + // Otherwise, check if every window in the map should be skipped (ignored) return std::all_of( m_windowMap.begin(), m_windowMap.end(), - [this, &ignore_list](const auto &window_repr) { return shouldSkipWindow(window_repr); }); + [this, &ignore_list](const auto &window_repr) { + return shouldSkipWindow(window_repr); + }); } void Workspace::updateTaskbar(const std::string &workspace_icon) { diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index 89b500a8..0b960733 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -158,7 +158,15 @@ void waybar::modules::MPD::setLabel() { if (title == "n/a" || artist == "n/a") { titleSmart = std::regex_replace(filename, std::regex(R"((\s*$$.*?$$)|(\.(mp3|m4a|opus|ogx))$)"), ""); } else { - titleSmart = static_cast(artist) + " - " + static_cast(title); + // Remove content within parentheses from the title + std::string cleanedTitle = std::regex_replace(static_cast(title), + std::regex(R"(\([^)]*\))"), + ""); + + // Also trim any trailing spaces that might be left after removing parentheses + cleanedTitle = std::regex_replace(cleanedTitle, std::regex(R"(\s+$)"), ""); + + titleSmart = static_cast(artist) + " - " + cleanedTitle; } song_pos = mpd_status_get_song_pos(status_.get()) + 1;