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

Pass conky object to external script #666

Closed sirfoga closed 11 months ago

sirfoga commented 5 years ago

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 first tcp connection

script: $ lsof -i :<PORT> | sed -n 2p | awk '{print $1}' i.e finds the process with that port

What I tried (unsuccessfully):

How do I do it?

PS: for reference, here is the link to the Stackoverflow question

varingst commented 5 years 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

github-actions[bot] commented 1 year ago

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.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stalled for 30 days with no activity.