2016-10-11 17:36:11 -04:00
|
|
|
#pragma once
|
|
|
|
|
2016-11-02 15:22:45 -04:00
|
|
|
#include <i3ipc++/ipc.hpp>
|
2016-10-11 17:36:11 -04:00
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-12-21 08:55:19 -05:00
|
|
|
#include "x11/extensions/randr.hpp"
|
2016-10-11 22:24:12 -04:00
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-10-11 17:36:11 -04:00
|
|
|
|
2016-11-26 00:13:20 -05:00
|
|
|
class connection;
|
|
|
|
|
2016-10-11 17:36:11 -04:00
|
|
|
namespace i3_util {
|
2016-10-11 21:57:22 -04:00
|
|
|
using connection_t = i3ipc::connection;
|
2016-12-13 18:46:33 -05:00
|
|
|
using workspace_t = i3ipc::workspace_t;
|
|
|
|
|
2016-12-13 22:42:21 -05:00
|
|
|
const auto ws_numsort = [](shared_ptr<workspace_t> a, shared_ptr<workspace_t> b) { return a->num < b->num; };
|
|
|
|
|
|
|
|
vector<shared_ptr<workspace_t>> workspaces(const connection_t& conn, const string& output = "");
|
2016-12-13 18:46:33 -05:00
|
|
|
shared_ptr<workspace_t> focused_workspace(const connection_t&);
|
2016-10-11 21:57:22 -04:00
|
|
|
|
2016-11-25 07:55:15 -05:00
|
|
|
vector<xcb_window_t> root_windows(connection& conn, const string& output_name = "");
|
2017-01-01 09:45:18 -05:00
|
|
|
bool restack_to_root(connection& conn, const monitor_t& mon, const xcb_window_t win);
|
2016-10-11 17:36:11 -04:00
|
|
|
}
|
|
|
|
|
2016-12-13 22:42:21 -05:00
|
|
|
namespace {
|
|
|
|
inline bool operator==(i3_util::workspace_t& a, i3_util::workspace_t& b) {
|
|
|
|
return a.num == b.num && a.output == b.output;
|
|
|
|
}
|
|
|
|
inline bool operator!=(i3_util::workspace_t& a, i3_util::workspace_t& b) {
|
|
|
|
return !(a == b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|