2016-11-19 03:03:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <xcb/xcb_ewmh.h>
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-11-26 05:14:58 +00:00
|
|
|
#include "utils/memory.hpp"
|
2022-03-06 15:40:42 +00:00
|
|
|
#include "utils/mixins.hpp"
|
2016-11-19 03:03:18 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS
|
2016-11-19 03:03:18 +00:00
|
|
|
|
2016-11-26 08:38:55 +00:00
|
|
|
struct position;
|
|
|
|
|
2016-11-19 03:03:18 +00:00
|
|
|
namespace ewmh_util {
|
2022-03-06 15:40:42 +00:00
|
|
|
class ewmh_connection : public non_copyable_mixin, public non_movable_mixin {
|
|
|
|
public:
|
|
|
|
ewmh_connection();
|
|
|
|
~ewmh_connection();
|
|
|
|
|
|
|
|
xcb_ewmh_connection_t* get();
|
|
|
|
|
|
|
|
private:
|
|
|
|
xcb_ewmh_connection_t c;
|
|
|
|
};
|
|
|
|
|
|
|
|
ewmh_connection& initialize();
|
2016-11-19 03:03:18 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
bool supports(xcb_atom_t atom, int screen = 0);
|
2016-11-19 03:03:18 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
string get_wm_name(xcb_window_t win);
|
|
|
|
string get_visible_name(xcb_window_t win);
|
|
|
|
string get_icon_name(xcb_window_t win);
|
2016-11-19 03:03:18 +00:00
|
|
|
string get_reply_string(xcb_ewmh_get_utf8_strings_reply_t* reply);
|
2016-11-26 05:14:58 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
vector<position> get_desktop_viewports(int screen = 0);
|
|
|
|
vector<string> get_desktop_names(int screen = 0);
|
|
|
|
unsigned int get_current_desktop(int screen = 0);
|
2019-02-08 12:32:31 +00:00
|
|
|
unsigned int get_number_of_desktops(int screen = 0);
|
2017-01-24 07:49:27 +00:00
|
|
|
xcb_window_t get_active_window(int screen = 0);
|
2016-11-26 09:33:32 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
void change_current_desktop(unsigned int desktop);
|
2017-02-20 07:25:19 +00:00
|
|
|
unsigned int get_desktop_from_window(xcb_window_t window);
|
2017-01-24 07:49:27 +00:00
|
|
|
|
|
|
|
void set_wm_window_type(xcb_window_t win, vector<xcb_atom_t> types);
|
2017-01-25 02:29:11 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
void set_wm_state(xcb_window_t win, vector<xcb_atom_t> states);
|
2017-01-25 02:29:11 +00:00
|
|
|
vector<xcb_atom_t> get_wm_state(xcb_window_t win);
|
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
void set_wm_pid(xcb_window_t win);
|
|
|
|
void set_wm_pid(xcb_window_t win, unsigned int pid);
|
2017-01-25 02:29:11 +00:00
|
|
|
|
2017-01-24 07:49:27 +00:00
|
|
|
void set_wm_desktop(xcb_window_t win, unsigned int desktop = -1u);
|
|
|
|
void set_wm_window_opacity(xcb_window_t win, unsigned long int values);
|
2017-01-25 02:29:11 +00:00
|
|
|
|
|
|
|
vector<xcb_window_t> get_client_list(int screen = 0);
|
2022-03-06 15:40:42 +00:00
|
|
|
} // namespace ewmh_util
|
2016-11-19 03:03:18 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|