-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if_match compare fails if locale uses "," as decimal mark #20
Comments
I have the same problem. |
Same here, can you tell please how to set a specific LOCALE for conky? |
You preface the command with eg.
|
Thanks, however it turns out comparing is failing in general with fraction numbers: conky: compare failed for expression ' 12,61 >= 10 '
|
Sorry my fault, the locale was not set it worked now. I use following startup script now:
Side note: It looks like it is in algebra.cc: enum arg_type get_arg_type. I recommend to use a locale aware number parser. |
Is this issue still outstanding in the current version of Conky? If so, please update the issue. Otherwise, the issue will be closed in 2 weeks. |
@lasers Can you have a look ? |
@su8 I tried. Not familiar with locale. Tried Italy. Didn't get commas to display. Maybe I did it wrong. |
@su8 I tried git bisect here to US.
DK.
|
Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one. Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.
Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one. Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.
Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one. Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.
* Try to amend #31 * BUILD_WLAN should be available for all OS. Keep BUILD_WLAN OFF by default for compatibility reasons. * WLAN-related variables should be available for every OS. There are some problems (probably null-dereference) * Fix $wireless_essid crashing conky if no argument provided. Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable. Also fix some documentation stuff. * Improve `get_freq` #20 Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one. Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless. * Oops, this accidently slipped in * Introduce BUILD_IPGFREQ build option This build option has been introduced for one particular reason: On macOS getting current core-frequency is not supported by the APIs. A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension. Though, this may trouble some alot, thus introduce BUILD_IPGFREQ. * Forgot static here. * Some improvements for get_freq again. Fix frequency not printing correctly (I wasn't using the divisor) Add more guards. * Setup cmake files and project code for Objective-C code #17 We want to use CoreWLAN framework. * update_cpu_usage() now supports multiple cores Also, some cleanup. * Updated default conky config to monitor Mac Networking * Made Mac Friendly BuildOptions and generic default conky configs * Undid Xdamage config and cleaned up previous IF statements * Re-Added XDamage fix * Finish up the algorithm. I think its now correct. Closes: #33 * Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables free_cpu() must be implemented for every OS and on all except macOS its a no-op function. * Reformat, add empty comment.
@su8 Just in case you missed the latest comment, I can test this now. |
This line is skipped when using locales that use ',' Line 158 in 7bca0ca
and returns Line 168 in 7bca0ca
which causes the "bad argument" to be printed Line 227 in 7bca0ca
Line 228 in 7bca0ca
|
Can you test this: diff --git a/src/algebra.cc b/src/algebra.cc
index 66dfd2d6..4e1d36e2 100644
--- a/src/algebra.cc
+++ b/src/algebra.cc
@@ -155,7 +155,7 @@ enum arg_type get_arg_type(const char *arg) {
if (p == e + 1) {
return ARG_LONG;
}
- if (*p == '.') {
+ if (*p == '.' || *p == ',') {
p++;
while (p <= e) {
if (isdigit((unsigned char)*p) == 0) { |
It works. The numbers get printed with comma too. Lazy copied the example above.
|
This happens in the master too. Hmm. Actually, I think this is okay as-is. Duh. |
Open up a pull request with this change as I'm lazy to do it 🍔 |
You're not lazy. I'm
Does that make sense or am I thinking too much? |
That's the current country standard, why changing it to other ? |
Idk. Noob here. I'll make a pull request at your request. What is |
Closed via #585 👋 |
* Try to amend #31 * BUILD_WLAN should be available for all OS. Keep BUILD_WLAN OFF by default for compatibility reasons. * WLAN-related variables should be available for every OS. There are some problems (probably null-dereference) * Fix $wireless_essid crashing conky if no argument provided. Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable. Also fix some documentation stuff. * Improve `get_freq` #20 Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one. Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless. * Oops, this accidently slipped in * Introduce BUILD_IPGFREQ build option This build option has been introduced for one particular reason: On macOS getting current core-frequency is not supported by the APIs. A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension. Though, this may trouble some alot, thus introduce BUILD_IPGFREQ. * Forgot static here. * Some improvements for get_freq again. Fix frequency not printing correctly (I wasn't using the divisor) Add more guards. * Setup cmake files and project code for Objective-C code #17 We want to use CoreWLAN framework. * update_cpu_usage() now supports multiple cores Also, some cleanup. * Updated default conky config to monitor Mac Networking * Made Mac Friendly BuildOptions and generic default conky configs * Undid Xdamage config and cleaned up previous IF statements * Re-Added XDamage fix * Finish up the algorithm. I think its now correct. Closes: #33 * Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables free_cpu() must be implemented for every OS and on all except macOS its a no-op function. * Reformat, add empty comment.
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
Need to do it manually. New version not completely backward compatible with old format. E.g.: double_buffer = yes --> crash! Using /usr/share/doc/conky-all/convert.lua New format from release 1.10.x Known issues in conky 1.10.x (2016): + if_match fail with locale: brndnmtthws/conky#20 + exec not work at first iteration: brndnmtthws/conky#112
From my log:
These compares are all similar to this one:
The compare still fails if the argument is written with ",". Explicitly setting conky's locale to en_US.UTF-8 works for now.
(This didn't happen in 1.9.0.)
The text was updated successfully, but these errors were encountered: