I am writting a BASH script to monitor a program's status. That program is close source and I have no control over it. It can create an icon in system tray.

What I need is knowing if currently there is an icon created by that program on system tray, so I get some infomation about that program.

How to list current system tray's all icons and their processes(PID)? Or how to get a PID's icon?


freedesktop.org's System Tray Protocol Specification and XEmbed Protocol Specification don't seem to provide any interface that allow people to list icons or proccesses. :(

  • I think that each tray zone(gnome,kde,xfce...) will have there own way of working. However I'm not sure this is easilly doable on any desktop env. What do you want to do with your bash script (the underlying goal. there might be a simpler way to do what you're trying to do.) You should try to always to explain de whole picture before the small details so we could help you choose a diidferent direction if requiered.
    – Kiwy
    Mar 4, 2019 at 11:13
  • 1
    I'm also looking for an answer to this. I saw that stalonetray seems to be doing this, so worst case we could probably dig into its source code. Currently, I'm lacking the time for that, though.
    – domsson
    Nov 24, 2019 at 5:48


You must log in to answer this question.

Browse other questions tagged .