diff --git a/src/conky.cc b/src/conky.cc index c85ff3d4..0fb0b2bc 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2772,8 +2772,9 @@ static void print_help(const char *prog_name) { #ifdef BUILD_X11 " -a, --alignment=ALIGNMENT text alignment on screen, " "{top,bottom,middle}_{left,right,middle}\n" - " -f, --font=FONT font to use\n" " -X, --display=DISPLAY X11 display to use\n" + " -m, --xinerama-head=N Xinerama monitor index (0=first)\n" + " -f, --font=FONT font to use\n" #ifdef OWN_WINDOW " -o, --own-window create own window to draw\n" #endif @@ -2805,7 +2806,7 @@ inline void reset_optind() { static const char *getopt_string = "vVqdDSs:t:u:i:hc:p:" #ifdef BUILD_X11 - "x:y:w:a:f:X:" + "x:y:w:a:X:m:f:" #ifdef OWN_WINDOW "o" #endif @@ -2825,8 +2826,8 @@ static const struct option longopts[] = { #endif {"daemonize", 0, nullptr, 'd'}, #ifdef BUILD_X11 - {"alignment", 1, nullptr, 'a'}, {"font", 1, nullptr, 'f'}, - {"display", 1, nullptr, 'X'}, + {"alignment", 1, nullptr, 'a'}, {"display", 1, nullptr, 'X'}, + {"xinerama-head", 1, nullptr, 'm'}, {"font", 1, nullptr, 'f'}, #ifdef OWN_WINDOW {"own-window", 0, nullptr, 'o'}, #endif @@ -2913,6 +2914,13 @@ void initialisation(int argc, char **argv) { state->pushstring(optarg); text_alignment.lua_set(*state); break; + case 'm': + state->pushinteger(strtol(optarg, &conv_end, 10)); + if (*conv_end != 0) { + CRIT_ERR(nullptr, nullptr, "'%s' is a wrong xinerama-head index", optarg); + } + head_index.lua_set(*state); + break; case 'X': state->pushstring(optarg); display_name.lua_set(*state); diff --git a/src/x11.cc b/src/x11.cc index 2a2169d1..bf4be528 100644 --- a/src/x11.cc +++ b/src/x11.cc @@ -304,7 +304,7 @@ conky::simple_config_setting text_alignment("alignment", BOTTOM_LEFT, false); conky::simple_config_setting display_name("display", std::string(), false); -static conky::simple_config_setting head_index("xinerama_head", 0, true); +conky::simple_config_setting head_index("xinerama_head", 0, true); priv::out_to_x_setting out_to_x; priv::colour_setting color[10] = {{"color0", 0xffffff}, {"color1", 0xffffff}, diff --git a/src/x11.h b/src/x11.h index 5c7e1e0f..740d52b2 100644 --- a/src/x11.h +++ b/src/x11.h @@ -220,6 +220,7 @@ class colour_setting extern priv::out_to_x_setting out_to_x; extern conky::simple_config_setting display_name; +extern conky::simple_config_setting head_index; extern priv::colour_setting color[10]; extern priv::colour_setting default_color; extern priv::colour_setting default_shade_color;