'How to keep Microsoft teams status active?
In Microsoft Teams, the status changes to "away" after a while being inactive.
Is there any way in Python to keep it active all the time?
Solution 1:[1]
one way worked for me on windows
this will keep your windows awake and prevent it from locking/hibernating
#Devil
import ctypes
import sys
#use this to reset the status
def display_reset():
ctypes.windll.kernel32.SetThreadExecutionState(0x80000000)
sys.exit(0)
def display_on():
print("Always On")
ctypes.windll.kernel32.SetThreadExecutionState(0x80000002)
display_on()
Solution 2:[2]
This works for me in Fedora. Just send the main Teams process a SIGUSR1 before the status changes. The script will continue in the background.
#!/bin/bash
signal() {
while sleep 60 ; do
kill ${1} ${2} || exit 0
done
}
PID=$(pgrep -f 'teams.*disable-setuid-sandbox')
[ -z "${PID}" ] && {
echo "${0}: Teams process not found" >&2
exit 1
}
(signal -SIGUSR1 ${PID}&)&
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Devil |
Solution 2 | Rudy Nijhof |