teams-for-linux icon indicating copy to clipboard operation
teams-for-linux copied to clipboard

Presence State (and other information) via dbus

Open smaugs opened this issue 2 years ago • 6 comments

Is it somehow possible to emit the current presence state via dbus? It would be awesome to use this and maybe other events (calender notifications, ...) my current usecase is to update the state of a connected USB busylight - but dbus is also a standard way to send Desktop Notifications.

smaugs avatar Feb 02 '23 10:02 smaugs

If it's helpful at all, this is the hacky method I've been using to determine if I'm in a call or not via cron: ps aux | grep -E '.*[t]eams-for-linux.*utility-sub-type=video_capture.mojom.VideoCaptureService.*'

I'm sure there's a better way.

r-cdriscoll avatar Feb 06 '23 15:02 r-cdriscoll

@smaugs I'm not so familiar with d-bus. It may not be easy, but if you suggest how would you do if it's not an electron app like something more close to the system? There may not be any possible options using electron libraries but using plain node js, we might be able to execute some shell commands that can possibly send data to d-bus and can be consumed by others. May be?

jijojosephk avatar Apr 29 '23 12:04 jijojosephk

I'd like to implement a busylight as well. I guess it would be enough to get the current presence state from a log file, but I couldn't find anything with that kind of information. Anyway I might try getting the process as @r-cdriscoll suggested.

theiltho avatar Jun 08 '23 08:06 theiltho

I am a bit lost on all of this. I am not sure if the electron browser sends much of the notifications into the app, and without them, it would be difficult to send them to you. I would have a think but do share if you find any information around this.

We use to check the app toolbar to know if we have messages and how many, that is how much of a hack we need to do sometimes due the limitations we face.

IsmaelMartinez avatar Sep 01 '23 11:09 IsmaelMartinez

I would like to use busylight as well. With the official Teams app, I was parsing the logs to get the call connected, call disconnected, screen sharing start / stop event, which I could propagate to my presence light. There was a dedicated log file that Teams app was writing and I just had to tail it. I think there is no such writing of log in the teams-for-linux version. However, by browsing other issues, I realized that running it in a shell window I could get some logs. When I start it as teams-for-linux --appLogLevels error,warn,info,debug then there are logs like [DEBUG] User status changed to '1' [DEBUG] User status changed to '5' [DEBUG] User status changed to '3' which roughly refer to call state. 3 is probably away, 1 is free, 5 is in call

Another issue mentioned the https://github.com/IsmaelMartinez/teams-for-linux/blob/develop/app/browser/tools/activityHub.js file which has callbacks like callConnectedHandler() and callDisconnectedHandler(). Would it be possible to put there some logging, which could appear on the console or even in a dedicated file?

(Sorry, I have no experience with electron based development, hence the basic question)

mrtati avatar Oct 27 '23 17:10 mrtati

can you check if you can hook something using the Pre-release 1.3.21?

https://github.com/IsmaelMartinez/teams-for-linux/releases/tag/v1.3.21

I have created also a discussion page in https://github.com/IsmaelMartinez/teams-for-linux/discussions/1019

It is not technically solving this problem, but add the availability to add a script. If that solution works for this sort of problems, we can add a "script" per event.

Thanks again!

IsmaelMartinez avatar Nov 14 '23 16:11 IsmaelMartinez

closing due inactivity

IsmaelMartinez avatar Mar 21 '24 10:03 IsmaelMartinez