andrew-bibb / cmst

QT GUI for Connman
174 stars 37 forks source link

Automatically hide from tray #235

Closed protist closed 2 years ago

protist commented 3 years ago

I use KDE, which has an option for icons in the tray to be "shown when relevant". For example, the removable-storage icon is only shown when storage is attached, the printer icon when something is printing, and the updater when there are new updates.

Almost all of the time, I don't need to know the status of my network, because when it's working properly, I can ignore it. However, I do want to know when I have disconnected, or when my VPN drops out. Would it be possible to have cmst hide from the tray in certain situations? I imagine this should be customisable by users.

EDIT: I'm aware of how to change colours of the icons, which gets me halfway there but leaves a gap in my tray.

andrew-bibb commented 3 years ago

QT has an option to make the tray icon visible or hidden so that part is easy. Thing I would need to to is figure out a triggering mechanism to change from one to another. I could probably key that into a change in the Connman service status, that is if it the topmost service changes the icon becomes visible. Sort of like I do with the VPN kill switch. Kind of thinking out load now, need to consider exactly how to do this and when to trigger it.

protist commented 3 years ago

Thanks @andrew-bibb! Sounds promising. Perhaps one option for deciding when to trigger it could be to read the config from ~/.config/cmst/cmst.icon? You could have a key there for visible or hidden?

andrew-bibb commented 3 years ago

Started to work on this are realized long time ago I put in an option to manually hide and show the icon. In the Preferences tab, left side about midway down. I'd forgotten I had even done it so probably too well hidden, but it is there.

Still going to continue with the automatic hide and show, just now need to figure how I can make these two similar but different controls work together in some rational manner.

protist commented 3 years ago

Thanks @andrew-bibb. From my perspective, I had actually already found the manual hide-and-show option, so I didn't think it was hidden too much.

Looking forward to the automatic options though. Thank you again!

andrew-bibb commented 2 years ago

After one false start and many side trips just uploaded the implementation of this one. Seems to work as intended so I am going to close this issue.