With the following config conky.config = {out_to_x=true, out_to_console=true}, conky can output the line incorrectly for the console.
Variables ${mem} and ${membar} were not printed in the output along with other working variables like ${memperc} and ${memmax}.
I was trying to understand why the behavior suddenly changed and that I didn't get correct output this time. Thinking back, I did replace conky-cli with conky-all several weeks ago.
Apparently, using conky.config = {out_to_console=true} in the conky.config was not enough to get a fully working out_to_console setup as we need to add out_to_x=false too.
I think the ideal behavior would be to print ${mem}, ${membar} and any other missing variables regardless instead of excluding them. However, I really don't need or want out_to_x behavior in first place so I'm just here to mention a potential non-consistent issue with the output.
Thank you.
diff --git a/src/conky.cc b/src/conky.cc
index 0fb0b2bc..337e118a 100644
--- a/src/conky.cc
+++ b/src/conky.cc
@@ -185,7 +185,7 @@ static conky::simple_config_setting<bool> short_units("short_units", false,
static conky::simple_config_setting<bool> format_human_readable(
"format_human_readable", true, true);
-static conky::simple_config_setting<bool> out_to_stdout("out_to_console",
+conky::simple_config_setting<bool> out_to_stdout("out_to_console",
// Default value is false, unless we are building without X
#ifdef BUILD_X11
false,
@@ -1860,7 +1860,7 @@ static void draw_text() {
for_each_line(text_buffer, draw_line);
#ifdef BUILD_HTTP
if (out_to_http.get(*state)) { webpage.append(WEBPAGE_END); }
-#endif
+#endif /* BUILD_HTTP */
}
static void draw_stuff() {
diff --git a/src/conky.h b/src/conky.h
index 46afb57d..49498f81 100644
--- a/src/conky.h
+++ b/src/conky.h
@@ -363,4 +363,6 @@ extern std::unique_ptr<lua::state> state;
extern int argc_copy;
extern char **argv_copy;
+extern conky::simple_config_setting<bool> out_to_stdout;
+
#endif /* _conky_h_ */
diff --git a/src/core.cc b/src/core.cc
index 7a438b2e..aea838f1 100644
--- a/src/core.cc
+++ b/src/core.cc
@@ -812,7 +812,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
END OBJ(image, nullptr) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_image_callback;
obj->callbacks.free = &gen_free_opaque;
-#endif /* BUILD_IMLIB2 */
+#endif /* BUILD_IMLIB2 && BUILD_X11 */
#ifdef BUILD_MYSQL
END OBJ_ARG(mysql, 0, "mysql needs a query") obj->data.s = strdup(arg);
obj->callbacks.print = &print_mysql;
diff --git a/src/specials.cc b/src/specials.cc
index bb19b13e..c5032f4a 100644
--- a/src/specials.cc
+++ b/src/specials.cc
@@ -40,6 +40,7 @@
#include "colours.h"
#include <algorithm>
#include <sstream>
+#include "conky.h"
struct special_t *specials = nullptr;
@@ -746,7 +747,8 @@ void new_bar(struct text_object *obj, char *p, unsigned int p_max_size, double u
#ifdef BUILD_X11
if (out_to_x.get(*state)) {
new_bar_in_x11(obj, p, usage);
- } else {
+ }
+ if (out_to_stdout.get(*state)) {
new_bar_in_shell(obj, p, p_max_size, usage);
}
#else /* BUILD_X11 */
diff --git a/src/x11.h b/src/x11.h
index 740d52b2..9be914df 100644
--- a/src/x11.h
+++ b/src/x11.h
@@ -155,7 +155,7 @@ class out_to_x_setting : public conky::simple_config_setting<bool> {
virtual void cleanup(lua::state &l);
public:
- out_to_x_setting() : Base("out_to_x", true, false) {}
+ out_to_x_setting() : Base("out_to_x", false, false) {}
};
class own_window_setting : public conky::simple_config_setting<bool> {
Now out_to_x=true/false needs to be set explicitly, same for the out_to_console=true/false.
$ git apply /tmp/xout
error: patch failed: src/specials.cc:40
error: src/specials.cc: patch does not apply
Not updating your branch? Anyhow, send it over the best way... through git tubes.
I went down to your level. It's one commit old and dirty. Anyhow, this work! You got everything... Well, not everything. memgauge is broken for me with both settings true. Fine when I turn off out_to_x.
Tomorrow will work on NIC exclusion.
Battery status too. Should be an easy PR. Goodnight? Edit; BYE JERK. IMMA SLEEPING NOW TOO.
Update, plz, @su8. You almost got this in the bag. <3
diff --git a/src/conky.cc b/src/conky.cc
index 0fb0b2bc..e8629def 100644
--- a/src/conky.cc
+++ b/src/conky.cc
@@ -185,7 +185,7 @@ static conky::simple_config_setting<bool> short_units("short_units", false,
static conky::simple_config_setting<bool> format_human_readable(
"format_human_readable", true, true);
-static conky::simple_config_setting<bool> out_to_stdout("out_to_console",
+conky::simple_config_setting<bool> out_to_stdout("out_to_console",
// Default value is false, unless we are building without X
#ifdef BUILD_X11
false,
@@ -1283,7 +1283,7 @@ static void draw_string(const char *s) {
webpage = string_replace_all(webpage, " ", " ", origlen);
webpage.append("<br />");
}
-#endif
+#endif /* BUILD_HTTP */
int tbs = text_buffer_size.get(*state);
memset(tmpstring1, 0, tbs);
memset(tmpstring2, 0, tbs);
diff --git a/src/conky.h b/src/conky.h
index 46afb57d..49498f81 100644
--- a/src/conky.h
+++ b/src/conky.h
@@ -363,4 +363,6 @@ extern std::unique_ptr<lua::state> state;
extern int argc_copy;
extern char **argv_copy;
+extern conky::simple_config_setting<bool> out_to_stdout;
+
#endif /* _conky_h_ */
diff --git a/src/core.cc b/src/core.cc
index fa6bb37b..b91a3456 100644
--- a/src/core.cc
+++ b/src/core.cc
@@ -812,7 +812,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
END OBJ(image, nullptr) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_image_callback;
obj->callbacks.free = &gen_free_opaque;
-#endif /* BUILD_IMLIB2 */
+#endif /* BUILD_IMLIB2 && BUILD_X11 */
#ifdef BUILD_MYSQL
END OBJ_ARG(mysql, 0, "mysql needs a query") obj->data.s = strdup(arg);
obj->callbacks.print = &print_mysql;
diff --git a/src/specials.cc b/src/specials.cc
index 912ed967..54d9fab4 100644
--- a/src/specials.cc
+++ b/src/specials.cc
@@ -41,6 +41,7 @@
#include <algorithm>
#include <sstream>
#include "common.h"
+#include "conky.h"
struct special_t *specials = nullptr;
@@ -422,7 +423,8 @@ void new_gauge(struct text_object *obj, char *p, unsigned int p_max_size, double
#ifdef BUILD_X11
if (out_to_x.get(*state)) {
new_gauge_in_x11(obj, p, usage);
- } else {
+ }
+ if (out_to_stdout.get(*state)) {
new_gauge_in_shell(obj, p, p_max_size, usage);
}
#else /* BUILD_X11 */
@@ -747,7 +749,8 @@ void new_bar(struct text_object *obj, char *p, unsigned int p_max_size, double u
#ifdef BUILD_X11
if (out_to_x.get(*state)) {
new_bar_in_x11(obj, p, usage);
- } else {
+ }
+ if (out_to_stdout.get(*state)) {
new_bar_in_shell(obj, p, p_max_size, usage);
}
#else /* BUILD_X11 */
diff --git a/src/x11.h b/src/x11.h
index 740d52b2..9be914df 100644
--- a/src/x11.h
+++ b/src/x11.h
@@ -155,7 +155,7 @@ class out_to_x_setting : public conky::simple_config_setting<bool> {
virtual void cleanup(lua::state &l);
public:
- out_to_x_setting() : Base("out_to_x", true, false) {}
+ out_to_x_setting() : Base("out_to_x", false, false) {}
};
class own_window_setting : public conky::simple_config_setting<bool> {
memgraph ?
conky.config = {
out_to_console=true,
out_to_x=true,
}
conky.text = [[
mem : ${mem}
memwithbuffers : ${memwithbuffers}
membar : ${membar 10,50}
memwithbuffersbar : ${memwithbuffersbar}
memdirty : ${memdirty}
memeasyfree : ${memeasyfree}
memfree : ${memfree}
memgauge : ${memgauge 11,100}
memgraph : ${memgraph 11,100}
memmax : ${memmax}
memperc : ${memperc}
------- : -------
]]
For some reason ${memgraph 11,100} on X and Console returns nothing. But here's a patch to respect out_to_console.
diff --git a/src/conky.cc b/src/conky.cc
index 0fb0b2bc..e8629def 100644
--- a/src/conky.cc
+++ b/src/conky.cc
@@ -185,7 +185,7 @@ static conky::simple_config_setting<bool> short_units("short_units", false,
static conky::simple_config_setting<bool> format_human_readable(
"format_human_readable", true, true);
-static conky::simple_config_setting<bool> out_to_stdout("out_to_console",
+conky::simple_config_setting<bool> out_to_stdout("out_to_console",
// Default value is false, unless we are building without X
#ifdef BUILD_X11
false,
@@ -1283,7 +1283,7 @@ static void draw_string(const char *s) {
webpage = string_replace_all(webpage, " ", " ", origlen);
webpage.append("<br />");
}
-#endif
+#endif /* BUILD_HTTP */
int tbs = text_buffer_size.get(*state);
memset(tmpstring1, 0, tbs);
memset(tmpstring2, 0, tbs);
diff --git a/src/conky.h b/src/conky.h
index 46afb57d..49498f81 100644
--- a/src/conky.h
+++ b/src/conky.h
@@ -363,4 +363,6 @@ extern std::unique_ptr<lua::state> state;
extern int argc_copy;
extern char **argv_copy;
+extern conky::simple_config_setting<bool> out_to_stdout;
+
#endif /* _conky_h_ */
diff --git a/src/core.cc b/src/core.cc
index fa6bb37b..b91a3456 100644
--- a/src/core.cc
+++ b/src/core.cc
@@ -812,7 +812,7 @@ struct text_object *construct_text_object(char *s, const char *arg, long line,
END OBJ(image, nullptr) obj->data.s = STRNDUP_ARG;
obj->callbacks.print = &print_image_callback;
obj->callbacks.free = &gen_free_opaque;
-#endif /* BUILD_IMLIB2 */
+#endif /* BUILD_IMLIB2 && BUILD_X11 */
#ifdef BUILD_MYSQL
END OBJ_ARG(mysql, 0, "mysql needs a query") obj->data.s = strdup(arg);
obj->callbacks.print = &print_mysql;
diff --git a/src/specials.cc b/src/specials.cc
index 912ed967..774c3b8c 100644
--- a/src/specials.cc
+++ b/src/specials.cc
@@ -41,6 +41,7 @@
#include <algorithm>
#include <sstream>
#include "common.h"
+#include "conky.h"
struct special_t *specials = nullptr;
@@ -422,7 +423,8 @@ void new_gauge(struct text_object *obj, char *p, unsigned int p_max_size, double
#ifdef BUILD_X11
if (out_to_x.get(*state)) {
new_gauge_in_x11(obj, p, usage);
- } else {
+ }
+ if (out_to_stdout.get(*state)) {
new_gauge_in_shell(obj, p, p_max_size, usage);
}
#else /* BUILD_X11 */
@@ -591,7 +593,7 @@ void new_graph(struct text_object *obj, char *buf, int buf_max_size,
#endif
graph_append(s, val, g->flags);
- if (not out_to_x.get(*state)) {
+ if (out_to_stdout.get(*state)) {
new_graph_in_shell(s, buf, buf_max_size);
}
}
@@ -747,7 +749,8 @@ void new_bar(struct text_object *obj, char *p, unsigned int p_max_size, double u
#ifdef BUILD_X11
if (out_to_x.get(*state)) {
new_bar_in_x11(obj, p, usage);
- } else {
+ }
+ if (out_to_stdout.get(*state)) {
new_bar_in_shell(obj, p, p_max_size, usage);
}
#else /* BUILD_X11 */
diff --git a/src/x11.h b/src/x11.h
index 740d52b2..9be914df 100644
--- a/src/x11.h
+++ b/src/x11.h
@@ -155,7 +155,7 @@ class out_to_x_setting : public conky::simple_config_setting<bool> {
virtual void cleanup(lua::state &l);
public:
- out_to_x_setting() : Base("out_to_x", true, false) {}
+ out_to_x_setting() : Base("out_to_x", false, false) {}
};
class own_window_setting : public conky::simple_config_setting<bool> {
For some reason ${memgraph 11,100} on X and Console returns nothing.
Try ${memgraph 10,50}. It works fine here, but 100 might be too long for either taste.
EDIT: It goes from right to left. You have to wait a minute or two.
new_graph_in_shell() is broken, conky is running from nearly 5 minutes and still got nothing, but with ${memgraph 10,50} on out_to_x I got it working right away.
This is with your latest patch. Dunno about before.

memwithbuffersbar is not respecting me... Tell it to respect me or it gets the lotion.
On my system even with ram load stress --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1, I can't get out_to_console to work properly, it shows nothing, but on X I get it working.
Does this happen on Manjaro liveCD too? EDIT: BSD problems?
I'm compiling a new kernel, will have to wait 10 minutes.
memwithbuffers doesn't depend on X and console.
I just confused memwithbuffers with memwithbuffersbar lol.
Both memwithbuffers/bar are working fine:
1.64G
#.........
3.33G
##........
9.29G
######....
You're right. I fscked up. I thought I specified it via default_bar_width = 50, but really, I specified explicit options for both bars. The issue was that it printed 10 chars instead of 50. Good lookin out. :fist_oncoming:
Make a PR?
On manjaro memgraph is working correctly. Go ahead and open up a PR with this patch, as on your branches conky-ci runs fine without any complains :D
I want your contributions to be counted because you're really a good contributor so I am not concerned at all about duplicate issues. You should be able to have many cookies contributions as you want. :star2:
But I've already opened a PR and everything will be sneaked in into #626
That's why you need to learn how to make branches. :-)
Always keep your master clean. From there, do git checkout -b su8-fixes-515 as it'll be based off the current branch (eg master), then now you're on a different branch (you can check this first with git status)... Add your code in there and push it out to upstream... I assume git push --force upstream.
@su8 Get messy. Do git checkout -b nic first... You now have nic stuffs on nic branch... then do git checkout master. Now you clean your master and follow above.
Will delete my conky fork and fork it again.
Stupid thing to do, lol.
git reset --hard upstream/master on your master, then git checkout -b su8-fixes-515... then git apply /tmp/su8-patch-above.txt...
How do I get the diff between two commits that have been committed and pushed already ? I mean to get the diff locally. I'd like to have my contributions as diffs and upload them to google drive, instead keeping multiple conky repos each renamed to conky-with-this-contribution.
edit: here's what I have currently:

Just found it out, git log followed by git diff COMMIT_SHA
You locally have one conky repo (or dir) containing commits, hashes, branches, etc. It's more efficient to use that instead of making diffs and uploading them to google drive since the branches can track changes for most parts.
I think you rush ask me this question so it's hard for me determine what you want to do here. You can view/produce diffs via git diff hashone hashtwo, git log -p hashone hashtwo, etc. Pipe them out for diffs. Also, there is git diff --staged to view changes between unstaged and staged files.
git diff LATEST_COMMIT doesn't work if the latest commit is the one that I want.
It works. It's likely not what you want so try different command. Sometimes I get branches or hashes switched up... or you even can use hashone...hashtwo (starting point to end point). git is too complicated for everybody to master.
Sometimes I try 20 commands before I find what I want. :-)
Duh I was trying to get the HEAD diff, lol.
@su8 Wow, that screenshot is awful. That's what branches are for... so it keeps everything really nice and super crazy organized. All you have to do is to give it a name, lol... then your commits can be kept there under that name.
EDIT: I just have this. :smile:

@su8 Earlier, I have 420 branches for py3status. I have to go through them all... (Some of them are remote tracking branches... so it's not my branches......but following other branches like yours).... I have to look through them, update them, sometimes rebase due to conflicts, and whatnot. Now I'm collaborator there, I'm trying to clean everything out... Imagine if I had 420 folders. Lol.
To get you organized, I think you need to make sure you're on latest master, then always work on a new branch... Good habit, otherwise, you accidentally branch off from a dirty master. Anyway, make a new branch, git apply your diff, if it went good, make a commit... then toss your diff away... and switch back to master... then again, new branch for each diff. Easier to track things.
EDIT: This is important... Always try to type good branch names and good commit messages. Otherwise, you'll wonder what conky-fix branch with wip: shit message does... so something like iface-nic-exclusion branch with iface: exclude unwanted nics (wip) message would be much better.
Close this as #628 have been merged ?
Most helpful comment
Close this as #628 have been merged ?