mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-29 18:18:39 +00:00
Make own_window_title a lua setting
This commit is contained in:
parent
fad11cabe1
commit
1960a511fd
@ -2574,7 +2574,6 @@ static void set_default_configurations(void)
|
||||
#ifdef OWN_WINDOW
|
||||
window.type = TYPE_NORMAL;
|
||||
window.hints = 0;
|
||||
sprintf(window.title, PACKAGE_NAME" (%s)", info.uname_s.nodename);
|
||||
#ifdef BUILD_ARGB
|
||||
use_argb_visual = 0;
|
||||
own_window_argb_value = 255;
|
||||
@ -3242,12 +3241,6 @@ char load_config_file(const char *f)
|
||||
}
|
||||
#ifdef BUILD_X11
|
||||
#ifdef OWN_WINDOW
|
||||
CONF("own_window_title") {
|
||||
if (value) {
|
||||
memset(window.title, 0, sizeof(window.title));
|
||||
strncpy(window.title, value, sizeof(window.title) - 1);
|
||||
}
|
||||
}
|
||||
CONF("own_window_transparent") {
|
||||
if (value) {
|
||||
set_transparent = string_to_bool(value);
|
||||
|
10
src/x11.cc
10
src/x11.cc
@ -378,7 +378,7 @@ void init_window(int w, int h, int set_trans, int back_colour,
|
||||
|
||||
XmbSetWMProperties(display, window.window, NULL, NULL, argv,
|
||||
argc, NULL, &wmHint, &classHint);
|
||||
XStoreName(display, window.window, window.title);
|
||||
XStoreName(display, window.window, own_window_title.get(*state).c_str() );
|
||||
|
||||
/* Sets an empty WM_PROTOCOLS property */
|
||||
XSetWMProtocols(display, window.window, NULL, 0);
|
||||
@ -940,4 +940,12 @@ conky::config_setting<bool> out_to_x("out_to_x", conky::simple_accessors<bool>(f
|
||||
conky::config_setting<bool> own_window("own_window", conky::simple_accessors<bool>(false, false));
|
||||
conky::config_setting<std::string> own_window_class("own_window_class",
|
||||
conky::simple_accessors<std::string>(PACKAGE_NAME, false));
|
||||
|
||||
namespace {
|
||||
// used to set the default value for own_window_title
|
||||
std::string gethostnamecxx()
|
||||
{ update_uname(); return info.uname_s.nodename; }
|
||||
}
|
||||
conky::config_setting<std::string> own_window_title("own_window_title",
|
||||
conky::simple_accessors<std::string>(PACKAGE_NAME " (" + gethostnamecxx()+")", false));
|
||||
#endif
|
||||
|
@ -83,7 +83,6 @@ struct conky_window {
|
||||
int width;
|
||||
int height;
|
||||
#ifdef OWN_WINDOW
|
||||
char title[256];
|
||||
int x;
|
||||
int y;
|
||||
unsigned int type;
|
||||
@ -158,6 +157,7 @@ extern conky::config_setting<bool> out_to_x;
|
||||
#ifdef OWN_WINDOW
|
||||
extern conky::config_setting<bool> own_window;
|
||||
extern conky::config_setting<std::string> own_window_class;
|
||||
extern conky::config_setting<std::string> own_window_title;
|
||||
#endif
|
||||
|
||||
#endif /*X11_H_*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user