Originally Posted by
dmillerct
This is something I have also wanted to do K, however because the lua load happens above TEXT and because I don't know enough about lua to create this in the script I gave up (for now)
You can't do conditionals between conky $if variable and LUA hook script.
Only thing you can is to do conditionals entirely in LUA and ditch Conky $if variables.
It is because the only LUA that you can use below TEXT is text processing Conky parsed script (no Cairo or Imlib2 in LUA here).
But... what's a beauty of using LUA and Cairo in Conky... one can read a Conky variable in LUA script and use it so it wouldn't be a problem to check if MPD is running
Code:
if conky_parse($mpd_status) == "playing" then myfunction_ring else return end
Originally Posted by
dmillerct
The issue is that for now the rings can only display native conky variables. So anything called by execpi execi, etc won't do.
Did you tryed?
$HOME/.conky/.conkyrc-test21
Code:
background no
update_interval 1
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 0 0
maximum_width 0
imlib_cache_size 0
lua_load $HOME/.conky/lua/test03.lua
lua_draw_hook_pre conky_main
TEXT
$HOME/.conky/lua/test03.lua
Code:
do
function conky_main()
print(conky_parse("${execi 60 uname -r}"))
end
end
run as
Code:
conky -c $HOME/.conky/.conkyrc-test21
and watch its terminal output
Bookmarks