2016-11-02 15:22:45 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <X11/Xresource.h>
|
|
|
|
|
|
|
|
#include "common.hpp"
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-11-02 15:22:45 -04:00
|
|
|
|
|
|
|
class xresource_manager {
|
|
|
|
public:
|
|
|
|
explicit xresource_manager();
|
|
|
|
|
2016-11-18 11:40:16 -05:00
|
|
|
string get_string(string name, string fallback = "") const;
|
|
|
|
float get_float(string name, float fallback = 0.0f) const;
|
|
|
|
int get_int(string name, int fallback = 0) const;
|
2016-11-02 15:22:45 -04:00
|
|
|
|
|
|
|
protected:
|
2016-11-25 07:55:15 -05:00
|
|
|
string load_value(const string& key, const string& res_type, size_t n) const;
|
2016-11-02 15:22:45 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
char* m_manager = nullptr;
|
|
|
|
XrmDatabase m_db;
|
|
|
|
};
|
|
|
|
|
2016-11-20 17:04:31 -05:00
|
|
|
di::injector<const xresource_manager&> configure_xresource_manager();
|
2016-11-02 15:22:45 -04:00
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|