Fix build & cleanup

Signed-off-by: Tin <tin.svagelj@live.com>
This commit is contained in:
Tin 2023-11-10 23:07:02 +01:00 committed by Brenden Matthews
parent cbebe44707
commit 20f9f60c6a
No known key found for this signature in database
GPG Key ID: 137B7AC2BDFD8DF0
8 changed files with 53 additions and 49 deletions

View File

@ -22,8 +22,8 @@ Conky can display more than 300 built-in objects, including support for:
usage**, disk usage, **"top"** like process stats, and **network usage**, disk usage, **"top"** like process stats, and **network
monitoring**, just to name a few). monitoring**, just to name a few).
- Built-in **IMAP** and **POP3** support. - Built-in **IMAP** and **POP3** support.
- Built-in support for many popular music players ([MPD][https://www.musicpd.org/], - Built-in support for many popular music players ([MPD][],
[XMMS2][https://github.com/XMMS2], [Audacious][https://audacious-media-player.org/]). [XMMS2][], [Audacious][]).
- Can be extended using built-in [**Lua**](lua) support, or any of your - Can be extended using built-in [**Lua**](lua) support, or any of your
own scripts and programs ([more](https://github.com/brndnmtthws/conky/wiki#tutorial)). own scripts and programs ([more](https://github.com/brndnmtthws/conky/wiki#tutorial)).
- Built-in [**Imlib2**][imlib2] and [**Cairo**][cairo] bindings for arbitrary drawing - Built-in [**Imlib2**][imlib2] and [**Cairo**][cairo] bindings for arbitrary drawing

View File

@ -167,8 +167,8 @@ else()
endif(OS_DARWIN) endif(OS_DARWIN)
dependent_option(BUILD_ARGB "Build ARGB (real transparency) support" true dependent_option(BUILD_ARGB "Build ARGB (real transparency) support" true
"OWN_WINDOW" false "BUILD_X11;OWN_WINDOW" false
"ARGB support requires OWN_WINDOW enabled") "ARGB support requires X11 and OWN_WINDOW enabled, not needed on Wayland")
dependent_option(BUILD_XINERAMA "Build Xinerama support" true dependent_option(BUILD_XINERAMA "Build Xinerama support" true
"BUILD_X11" false "BUILD_X11" false
"Xinerama support requires X11") "Xinerama support requires X11")

View File

@ -287,26 +287,26 @@ values:
isn't reached, the next char will start on a new line. If you want to isn't reached, the next char will start on a new line. If you want to
make sure that lines don't get broken, set 'width' to 0. make sure that lines don't get broken, set 'width' to 0.
args: args:
- seconds - integer_number
- name: max_user_text - name: max_user_text
desc: |- desc: |-
Maximum size of user text buffer in bytes, i.e. text inside Maximum size of user text buffer in bytes, i.e. text inside
conky.text section in config file. conky.text section in config file.
default: 16384 default: 16384
args: args:
- seconds - integer_number
- name: maximum_width - name: maximum_width
desc: Maximum width of window. desc: Maximum width of window.
args: args:
- seconds - integer_number
- name: minimum_height - name: minimum_height
desc: Minimum height of the window. desc: Minimum height of the window.
args: args:
- seconds - integer_number
- name: minimum_width - name: minimum_width
desc: Minimum width of window. desc: Minimum width of window.
args: args:
- seconds - integer_number
- name: mpd_host - name: mpd_host
desc: Host of MPD server. desc: Host of MPD server.
- name: mpd_password - name: mpd_password
@ -375,12 +375,15 @@ values:
When ARGB visuals are enabled, this use this to modify the When ARGB visuals are enabled, this use this to modify the
alpha value used. Valid range is 0-255, where 0 is 0% opacity, and 255 alpha value used. Valid range is 0-255, where 0 is 0% opacity, and 255
is 100% opacity. is 100% opacity.
default: 255
args:
- integer_number
- name: own_window_argb_visual - name: own_window_argb_visual
desc: |- desc: |-
Boolean, use ARGB visual? ARGB can be used for real Boolean, use ARGB visual? ARGB can be used for real transparency, note
transparency, note that a composite manager is required for real that a composite manager is required on X11.
transparency. This option will not work as desired (in most cases) in This option will not work as desired (in most cases) in conjunction with
conjunction with 'own_window_type override'. 'own_window_type override'.
- name: own_window_class - name: own_window_class
desc: Manually set the WM_CLASS name. desc: Manually set the WM_CLASS name.
default: Conky default: Conky
@ -392,16 +395,16 @@ values:
(see `/usr/lib/X11/rgb.txt`). (see `/usr/lib/X11/rgb.txt`).
default: black default: black
args: args:
- seconds - color
- name: own_window_hints - name: own_window_hints
desc: |- desc: |-
If own_window is yes, you may use these window manager hints If own_window is yes, you may specify comma separated window manager hints
to affect the way Conky displays. Notes: Use own_window_type desktop to affect the way Conky displays. Notes: Use own_window_type desktop
as another way to implement many of these hints implicitly. If you use as another way to implement many of these hints implicitly. If you use
own_window_type override, window manager hints have no meaning and are own_window_type override, window manager hints have no meaning and are
ignored. ignored.
args: args:
- seconds - hint(,hint)*
- name: own_window_title - name: own_window_title
desc: |- desc: |-
Manually set the window name. Manually set the window name.

View File

@ -946,19 +946,15 @@ void display_output_wayland::end_draw_stuff() {
void display_output_wayland::clear_text(int exposures) { void display_output_wayland::clear_text(int exposures) {
struct window *window = global_window; struct window *window = global_window;
cairo_save(window->cr); cairo_save(window->cr);
Colour color; Colour color;
#ifdef OWN_WINDOW
color = background_colour.get(*state);
if (set_transparent.get(*state)) { if (set_transparent.get(*state)) {
color.alpha = 0; color.alpha = 0;
} else { } else {
#ifdef BUILD_ARGB color = background_colour.get(*state);
color.alpha = own_window_argb_value.get(*state); color.alpha = own_window_argb_value.get(*state);
#else
color.alpha = 0xff;
#endif
} }
#endif
cairo_set_source_rgba(window->cr, color.red / 255.0, color.green / 255.0, cairo_set_source_rgba(window->cr, color.red / 255.0, color.green / 255.0,
color.blue / 255.0, color.alpha / 255.0); color.blue / 255.0, color.alpha / 255.0);
cairo_set_operator(window->cr, CAIRO_OPERATOR_SOURCE); cairo_set_operator(window->cr, CAIRO_OPERATOR_SOURCE);

View File

@ -59,8 +59,6 @@ void x11_init_window(lua::state &l, bool own);
/********************* <SETTINGS> ************************/ /********************* <SETTINGS> ************************/
priv::colour_setting background_colour("own_window_colour", 0);
bool out_to_gui(lua::state &l) { bool out_to_gui(lua::state &l) {
bool to_gui = false; bool to_gui = false;
#ifdef BUILD_X11 #ifdef BUILD_X11
@ -203,24 +201,31 @@ conky::range_config_setting<int> border_width("border_width", 0,
1, true); 1, true);
#ifdef OWN_WINDOW #ifdef OWN_WINDOW
conky::simple_config_setting<bool> set_transparent("own_window_transparent",
false, false);
conky::simple_config_setting<std::string> own_window_class("own_window_class",
PACKAGE_NAME, false);
conky::simple_config_setting<std::string> own_window_title( conky::simple_config_setting<std::string> own_window_title(
"own_window_title", PACKAGE_NAME " (" + gethostnamecxx() + ")", false); "own_window_title", PACKAGE_NAME " (" + gethostnamecxx() + ")", false);
#endif /* OWN_WINDOW */
#if defined(OWN_WINDOW) && defined(BUILD_X11)
conky::simple_config_setting<std::string> own_window_class("own_window_class",
PACKAGE_NAME, false);
conky::simple_config_setting<window_type> own_window_type("own_window_type", conky::simple_config_setting<window_type> own_window_type("own_window_type",
TYPE_NORMAL, false); TYPE_NORMAL, false);
conky::simple_config_setting<uint16_t, window_hints_traits> own_window_hints( conky::simple_config_setting<uint16_t, window_hints_traits> own_window_hints(
"own_window_hints", 0, false); "own_window_hints", 0, false);
#endif /* OWN_WINDOW && BUILD_X11 */
#ifdef BUILD_ARGB #if defined(OWN_WINDOW) || defined(BUILD_WAYLAND)
priv::colour_setting background_colour("own_window_colour", 0);
conky::simple_config_setting<bool> set_transparent("own_window_transparent",
false, false);
#endif /* OWN_WINDOW || BUILD_WAYLAND */
#if defined(BUILD_ARGB) || defined(BUILD_WAYLAND)
conky::simple_config_setting<bool> use_argb_visual("own_window_argb_visual",
false, false);
conky::range_config_setting<int> own_window_argb_value("own_window_argb_value", conky::range_config_setting<int> own_window_argb_value("own_window_argb_value",
0, 255, 255, false); 0, 255, 255, false);
#endif /* BUILD_ARGB */ #endif /* BUILD_ARGB || BUILD_WAYLAND */
#endif /* OWN_WINDOW */
priv::own_window_setting own_window; priv::own_window_setting own_window;
/******************** </SETTINGS> ************************/ /******************** </SETTINGS> ************************/

View File

@ -109,26 +109,30 @@ extern conky::range_config_setting<int> border_width;
extern conky::simple_config_setting<bool> forced_redraw; extern conky::simple_config_setting<bool> forced_redraw;
#ifdef OWN_WINDOW #ifdef OWN_WINDOW
extern conky::simple_config_setting<bool> set_transparent; extern priv::own_window_setting own_window;
extern conky::simple_config_setting<std::string> own_window_class;
extern conky::simple_config_setting<std::string> own_window_title; extern conky::simple_config_setting<std::string> own_window_title;
extern conky::simple_config_setting<window_type> own_window_type; #endif /* OWN_WINDOW */
#if defined(OWN_WINDOW) && defined(BUILD_X11)
struct window_hints_traits { struct window_hints_traits {
static const lua::Type type = lua::TSTRING; static const lua::Type type = lua::TSTRING;
typedef uint16_t Type; typedef uint16_t Type;
static std::pair<Type, bool> convert(lua::state &l, int index, static std::pair<Type, bool> convert(lua::state &l, int index,
const std::string &name); const std::string &name);
}; };
extern conky::simple_config_setting<std::string> own_window_class;
extern conky::simple_config_setting<window_type> own_window_type;
extern conky::simple_config_setting<uint16_t, window_hints_traits> extern conky::simple_config_setting<uint16_t, window_hints_traits>
own_window_hints; own_window_hints;
#endif /* OWN_WINDOW && BUILD_X11 */
#ifdef BUILD_ARGB #if defined(OWN_WINDOW) || defined(BUILD_WAYLAND)
extern priv::colour_setting background_colour; extern priv::colour_setting background_colour;
extern conky::simple_config_setting<bool> use_argb_visual; extern conky::simple_config_setting<bool> set_transparent;
#endif /* OWN_WINDOW || BUILD_WAYLAND */
/* range of 0-255 for alpha */ #if defined(BUILD_ARGB) || defined(BUILD_WAYLAND)
extern conky::simple_config_setting<bool> use_argb_visual;
extern conky::range_config_setting<int> own_window_argb_value; extern conky::range_config_setting<int> own_window_argb_value;
#endif /*BUILD_ARGB*/ #endif /* BUILD_ARGB || BUILD_WAYLAND */
#endif /*OWN_WINDOW*/
extern priv::own_window_setting own_window;

View File

@ -187,6 +187,9 @@ static void print_version() {
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
#ifdef BUILD_WAYLAND #ifdef BUILD_WAYLAND
<< _(" Wayland:\n") << _(" Wayland:\n")
#ifdef BUILD_ARGB
<< _(" * ARGB visual\n")
#endif /* BUILD_ARGB */
#ifdef BUILD_MOUSE_EVENTS #ifdef BUILD_MOUSE_EVENTS
<< _(" * Mouse events\n") << _(" * Mouse events\n")
#endif /* BUILD_MOUSE_EVENTS */ #endif /* BUILD_MOUSE_EVENTS */

View File

@ -216,13 +216,6 @@ conky::simple_config_setting<bool> use_xft("use_xft", false, false);
conky::simple_config_setting<bool> forced_redraw("forced_redraw", false, false); conky::simple_config_setting<bool> forced_redraw("forced_redraw", false, false);
#ifdef OWN_WINDOW
#ifdef BUILD_ARGB
conky::simple_config_setting<bool> use_argb_visual("own_window_argb_visual",
false, false);
#endif /* BUILD_ARGB */
#endif /* OWN_WINDOW */
#ifdef BUILD_XDBE #ifdef BUILD_XDBE
priv::use_xdbe_setting use_xdbe; priv::use_xdbe_setting use_xdbe;
#else #else