Skip to content
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

Trouble getting this working now/errors #5

Closed
neurotix84 opened this issue Mar 14, 2024 · 3 comments
Closed

Trouble getting this working now/errors #5

neurotix84 opened this issue Mar 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@neurotix84
Copy link

neurotix84 commented Mar 14, 2024

Hi, I really want to use this script in my conky.

I am pretty sure I have it setup correctly, and I am calling it per the readme in my conky.

However, I get an error on line 249 running it in the terminal saying "attempt to reference a nil value" and subsequently the script only outputs FAH_proj nil and does not display the project number or completion status.

Does this script require Fahcontrol to be running? Because it doesn't work on Linux Mint 21, I think because there's no support for GTK 2 anymore.

Thanks for any help.

@dfyockey
Copy link
Owner

dfyockey commented Mar 15, 2024

Hi @neurotix84,

The error you noted suggests that there's no project number loaded into the program. The object ${lua load_fah_queue_info} calls the function to load the current info from FAHClient including project numbers. So to eliminate the simplest possible cause, please make sure that you included ${lua load_fah_queue_info} in your conky config file somewhere before any objects that call functions listed in the table.

If that isn't the problem, please post the portion(s) of your conky config file pertaining to your setup for the script, and I'll try to reproduce the issue and fix what needs fixing.

The script doesn't require Fahcontrol to be running. It does require a running FAHClient, although folding can be paused.

GTK version shouldn't have an effect on the script since it runs completely inside of conky and just loads and parses text from the FAHClient for display by conky. However, in case it comes to testing on there, are you running Mint 21.1, .2, .3, or just 21? And am I correct to assume that you're running the Cinnamon DE?

David

@dfyockey dfyockey added the bug Something isn't working label Mar 15, 2024
@neurotix84
Copy link
Author

neurotix84 commented Mar 15, 2024

Hello,

It all seems to be working perfectly now, I'm thrilled! All I did was leave my machine running overnight, came back to it and saw "F@H Proj 18220 READY" instead of just F@H Proj nil. Moreover, when I fired up my client it said the progress in percentage and estimated time to complete. What I'm wondering is, if it just took the script a while to load and function correctly or something.

It works, and I also just checked and it works right away upon loading the conky, however I checked running it in a terminal and I'm getting:

/conky/folding.lua:249: bad argument #2 to 'format' (number expected, got nil) (this stops after a few times)
conky: llua_getstring: function conky_load_fah_queue_info didn't return a string, result discarded (this continues to show in the terminal for some time, then stops, then starts again when my conky grabs data with a different script I use)

Also, I only brought up GTK version as it appears Fahcontrol needs gtk2 and python-gtk2 available and none are available in the repos I have. It's good to know I don't need it because it'd be a big pain getting it working using Debian repos.

Also, you are correct. I run Linux Mint Cinnamon 21.2

Here's the relevant sections of my conky script:

lua_load = '~/conky/music.lua ~/conky/folding.lua', (right at the end of the conky config)

#------------+
${voffset 10}${color1}${font Noto Sans Mono CJK JP:size=14:bold}FOLDING ${hr 2}${font}${color}
${lua load_fah_queue_info}
F@H Proj ${lua fah_project 0} ${lua fah_status 0}
#------------+
]]

dfyockey added a commit that referenced this issue Mar 17, 2024
Resolve script 'bad argument' errors at start. Problem of script
not starting to display data until next day will be considered later
in a follow-up issue.

In README, further improve by addressing spurious blank line insertion.
@dfyockey
Copy link
Owner

@neurotix84,

Thanks for pointing out the errors appearing when running conky in a terminal. That was due to my failure to properly set an iteration count variable so data would be loaded from the start, which would cause a delay of several conky update iterations in the script's getting up and running. It also brought to my attention a need to add something to the readme about the throttling variable that can be set to control the update frequency. Both bits have now been fixed.

Assuming that you've renamed fahqi.lua to folding.lua, your conky script setup all looks good.

I can't remember and it may take a while to verify, but I think that the script will display "nil" if no project is currently available for folding. Nothing being available one day but something becoming available the next would explain the behavoir you observed. I'll post a new issue about this to keep it in mind. If I can verify that it's due to nothing being available, I'll see about modifying the script with reference to that issue to display something more descriptive than "nil" when it occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants