This commit is contained in:
Alex
2018-08-20 14:50:45 +02:00
committed by GitHub
parent b7e3d10fb7
commit 49232eed8d
30 changed files with 261 additions and 235 deletions

View File

@ -6,16 +6,17 @@
#include "util/chrono.hpp"
#include "util/json.hpp"
#include "IModule.hpp"
#include "modules/sway/ipc/client.hpp"
namespace waybar::modules::sway {
class Workspaces : public IModule {
public:
Workspaces(waybar::Bar&, Json::Value);
~Workspaces();
Workspaces(waybar::Bar&, const Json::Value&);
auto update() -> void;
operator Gtk::Widget &();
private:
void worker();
void addWorkspace(Json::Value);
std::string getIcon(std::string);
bool handleScroll(GdkEventScroll*);
@ -23,7 +24,7 @@ class Workspaces : public IModule {
int getNextWorkspace();
Bar& bar_;
Json::Value config_;
const Json::Value& config_;
waybar::util::SleeperThread thread_;
Gtk::Box box_;
util::JsonParser parser_;
@ -31,8 +32,7 @@ class Workspaces : public IModule {
bool scrolling_;
std::unordered_map<int, Gtk::Button> buttons_;
Json::Value workspaces_;
int ipcfd_;
int ipc_eventfd_;
Ipc ipc_;
};
}