Closed sirfoga closed 11 months ago
If all you want is to see what conky evaluates the expression to, you can create a conkyrc that only outputs to console, and run conky only one tick:
$ conky -i 1 -c special_conkyrc -t '${tcp_portmon 1 61000 lport 0}'
That said, conky is almost certainly the wrong tool for the job here. Try ss -tnp
or netstat -tnp
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
I have a conky object, and I want to pass it as parameter of a
bash
/lua
script. How do I do it?Example:
conky object:
${tcp_portmon 1 61000 lport 0}
i.e the port of the firsttcp
connectionscript:
$ lsof -i :<PORT> | sed -n 2p | awk '{print $1}'
i.e finds the process with that portWhat I tried (unsuccessfully):
${exec lsof -i :${tcp_portmon 1 61000 lport 0} | sed -n 2p | awk '{print $1}'}
${exec echo $(lsof -i :${tcp_portmon 1 61000 lport 0} | sed -n 2p | awk '{print $1}')}
${lua conky_proc_port ${tcp_portmon 1 61000 lport 0}}
, whereconky_proc_port
simply outputs the parameterHow do I do it?
PS: for reference, here is the link to the Stackoverflow question