brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.17k stars 615 forks source link

$if_existing statement issue #449

Closed bad-interpreter closed 6 years ago

bad-interpreter commented 6 years ago

Hi, I'm in Slackware64-current. I'm using conky-1.10.6 and I'm experiencing a issue with the ${if_existing} variable: Assuming that the file /dev/shm/void.txt doesn't exist, the code:

conky.text = [[
${if_existing /dev/shm/void.txt}${execp cat /dev/shm/void.txt}${endif}
]]

doesn't actually display nothing, but the the terminal output is quite inconsistent:


$ conky -D -c conkyrc-test 
conky: Can't set the specified locale!
Check LANG, LC_CTYPE, LC_ALL.
DEBUG(0) [/tmp/SBo/conky-1.10.6/src/conky.cc:2698]: reading contents from config file 'conkyrc-test'
conky: Invalid value of type 'number' for setting 'display'. Expected value of type 'string'.
DEBUG(0) [/tmp/SBo/conky-1.10.6/src/x11.cc:497]: Fixed xinerama area to: 0 0 1920 1080
DEBUG(0) [/tmp/SBo/conky-1.10.6/src/x11.cc:497]: Fixed xinerama area to: 0 0 1920 1080
conky: desktop window (1200003) is subwindow of root window (1e3)
conky: window type - desktop
conky: drawing to created window (0x3200001)
conky: drawing to double buffer
cat: /dev/shm/void.txt: No such file or directory
cat: /dev/shm/void.txt: No such file or directory
cat: /dev/shm/void.txt: No such file or directory

It seems to perform the false state, even though not displaying it.

easysid commented 6 years ago

See #334, and #318

It seems ${if_} conditionals only work on printing info, and not on execs. There are workarounds mentioned in the above issues.

bad-interpreter commented 6 years ago

It's a workaround, but still ...it works.

Thanks