2016-10-11 21:36:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-11-02 19:22:45 +00:00
|
|
|
#include <i3ipc++/ipc.hpp>
|
2016-10-11 21:36:11 +00:00
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-12-21 13:55:19 +00:00
|
|
|
#include "x11/extensions/randr.hpp"
|
2016-10-12 02:24:12 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS
|
2016-10-11 21:36:11 +00:00
|
|
|
|
2016-11-26 05:13:20 +00:00
|
|
|
class connection;
|
|
|
|
|
2016-10-11 21:36:11 +00:00
|
|
|
namespace i3_util {
|
2016-10-12 01:57:22 +00:00
|
|
|
using connection_t = i3ipc::connection;
|
2016-12-13 23:46:33 +00:00
|
|
|
using workspace_t = i3ipc::workspace_t;
|
|
|
|
|
2016-12-14 03:42:21 +00:00
|
|
|
const auto ws_numsort = [](shared_ptr<workspace_t> a, shared_ptr<workspace_t> b) { return a->num < b->num; };
|
|
|
|
|
2021-02-15 20:31:34 +00:00
|
|
|
vector<shared_ptr<workspace_t>> workspaces(const connection_t& conn, const string& output = "", const bool show_urgent = false);
|
2016-12-13 23:46:33 +00:00
|
|
|
shared_ptr<workspace_t> focused_workspace(const connection_t&);
|
2016-10-12 01:57:22 +00:00
|
|
|
|
2016-11-25 12:55:15 +00:00
|
|
|
vector<xcb_window_t> root_windows(connection& conn, const string& output_name = "");
|
2023-05-15 11:22:38 +00:00
|
|
|
xcb_window_t get_restack_sibling(connection& conn);
|
2016-10-11 21:36:11 +00:00
|
|
|
}
|
|
|
|
|
2016-12-14 03:42:21 +00: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 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|