2018-08-08 21:54:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <json/json.h>
|
|
|
|
#include <fmt/format.h>
|
|
|
|
#include "bar.hpp"
|
|
|
|
#include "client.hpp"
|
|
|
|
#include "util/chrono.hpp"
|
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
|
|
|
class WorkspaceSelector {
|
|
|
|
public:
|
|
|
|
WorkspaceSelector(waybar::Bar &bar);
|
|
|
|
auto update() -> void;
|
2018-08-08 23:10:07 +00:00
|
|
|
void updateThread();
|
2018-08-08 21:54:58 +00:00
|
|
|
operator Gtk::Widget &();
|
2018-08-08 23:10:07 +00:00
|
|
|
util::SleeperThread *thread;
|
2018-08-08 21:54:58 +00:00
|
|
|
private:
|
|
|
|
void _addWorkspace(Json::Value node);
|
|
|
|
Json::Value _getWorkspaces();
|
|
|
|
Bar &_bar;
|
|
|
|
Gtk::Box *_box;
|
|
|
|
std::unordered_map<int, Gtk::Button> _buttons;
|
|
|
|
int _ipcSocketfd;
|
|
|
|
int _ipcEventSocketfd;
|
2018-08-08 23:10:07 +00:00
|
|
|
struct org_kde_kwin_idle_timeout *_idle_timer;
|
2018-08-08 21:54:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|