From 7952846e07b37ba158f326bbcbda7a93f6ae2e98 Mon Sep 17 00:00:00 2001 From: Julia Date: Wed, 21 Dec 2022 21:09:38 +0100 Subject: [PATCH] Added the files I forgot to add --- include/factory.hpp | 1 + meson.build | 1 + src/factory.cpp | 3 +++ src/modules/sway/bar.cpp | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/factory.hpp b/include/factory.hpp index d69930f9..693c3cef 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -11,6 +11,7 @@ #include "modules/sway/mode.hpp" #include "modules/sway/scratchpad.hpp" #include "modules/sway/window.hpp" +#include "modules/sway/windows.hpp" #include "modules/sway/workspaces.hpp" #endif #ifdef HAVE_WLR diff --git a/meson.build b/meson.build index 557a02dc..5da61699 100644 --- a/meson.build +++ b/meson.build @@ -197,6 +197,7 @@ src_files += [ 'src/modules/sway/mode.cpp', 'src/modules/sway/language.cpp', 'src/modules/sway/window.cpp', + 'src/modules/sway/windows.cpp', 'src/modules/sway/workspaces.cpp', 'src/modules/sway/scratchpad.cpp' ] diff --git a/src/factory.cpp b/src/factory.cpp index d16cb523..a6546769 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -32,6 +32,9 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "sway/window") { return new waybar::modules::sway::Window(id, bar_, config_[name]); } + if (ref == "sway/windows") { + return new waybar::modules::sway::Windows(id, bar_, config_[name]); + } if (ref == "sway/language") { return new waybar::modules::sway::Language(id, config_[name]); } diff --git a/src/modules/sway/bar.cpp b/src/modules/sway/bar.cpp index f28b0502..d8c0de13 100644 --- a/src/modules/sway/bar.cpp +++ b/src/modules/sway/bar.cpp @@ -24,12 +24,16 @@ BarIpcClient::BarIpcClient(waybar::Bar& bar) : bar_{bar} { subscribe_events.append("barconfig_update"); bool has_mode = isModuleEnabled("sway/mode"); + bool has_windows = isModuleEnabled("sway/windows"); bool has_workspaces = isModuleEnabled("sway/workspaces"); if (has_mode) { subscribe_events.append("mode"); } - if (has_workspaces) { + if (has_windows) { + subscribe_events.append("window"); + } + if (has_workspaces||has_windows) { subscribe_events.append("workspace"); } if (has_mode || has_workspaces) {