2016-11-18 22:03:18 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <xcb/xcb_ewmh.h>
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-11-26 00:14:58 -05:00
|
|
|
#include "utils/memory.hpp"
|
2016-11-18 22:03:18 -05:00
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-11-18 22:03:18 -05:00
|
|
|
|
2016-11-26 03:38:55 -05:00
|
|
|
struct position;
|
|
|
|
|
2016-11-26 00:14:58 -05:00
|
|
|
using ewmh_connection_t = memory_util::malloc_ptr_t<xcb_ewmh_connection_t>;
|
|
|
|
|
2016-11-18 22:03:18 -05:00
|
|
|
namespace ewmh_util {
|
2016-11-26 00:14:58 -05:00
|
|
|
ewmh_connection_t initialize();
|
2016-11-18 22:03:18 -05:00
|
|
|
|
2016-11-26 00:14:58 -05:00
|
|
|
bool supports(xcb_ewmh_connection_t* ewmh, xcb_atom_t atom, int screen = 0);
|
2016-11-18 22:03:18 -05:00
|
|
|
|
2016-11-30 07:38:40 -05:00
|
|
|
string get_wm_name(xcb_ewmh_connection_t* conn, xcb_window_t win);
|
2016-11-18 22:03:18 -05:00
|
|
|
string get_visible_name(xcb_ewmh_connection_t* conn, xcb_window_t win);
|
|
|
|
string get_icon_name(xcb_ewmh_connection_t* conn, xcb_window_t win);
|
|
|
|
string get_reply_string(xcb_ewmh_get_utf8_strings_reply_t* reply);
|
2016-11-26 00:14:58 -05:00
|
|
|
|
2016-11-26 03:38:55 -05:00
|
|
|
vector<position> get_desktop_viewports(xcb_ewmh_connection_t* conn, int screen = 0);
|
2016-11-26 00:14:58 -05:00
|
|
|
vector<string> get_desktop_names(xcb_ewmh_connection_t* conn, int screen = 0);
|
|
|
|
uint32_t get_current_desktop(xcb_ewmh_connection_t* conn, int screen = 0);
|
|
|
|
xcb_window_t get_active_window(xcb_ewmh_connection_t* conn, int screen = 0);
|
2016-11-26 04:33:32 -05:00
|
|
|
|
|
|
|
void change_current_desktop(xcb_ewmh_connection_t* conn, uint32_t desktop);
|
2016-11-18 22:03:18 -05:00
|
|
|
}
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|