Created
October 28, 2019 08:26
-
-
Save rwese/3eb6b3a393fa4fa1cf2e4b43ed72181e to your computer and use it in GitHub Desktop.
Restart MS Teams with "disable-gpu" to reduce battery consumption.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Created 2019-04, Author: René Weselowski <[email protected]> | |
# | |
# This script is entended as an macos automator 'application' run at startup | |
# to kill the MSTeams process and restart it wiith '--disable-gpu' | |
# | |
# Usage: | |
# Create a new automator task "Run Shell Script" | |
# Shell: /bin/bash | |
# Put it into your login/startup items | |
# | |
pkill Teams; sleep 1 | |
# wait for msteams to shutdown | |
while [ `(pgrep -a Teams| wc -l)` -gt '1' ]; do sleep 1; pkill Teams; done | |
# to start a process fully in background automator needs some special care, so nohup + & and disowning it. | |
nohup /Applications/Microsoft\ Teams.app/Contents/MacOS/Teams --disable-gpu > /dev/null 2>&1 & | |
disown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment