Skip to content

Commit 56cd2b1

Browse files
committed
setup_teams_call.sh: add on/off args
1 parent 3e10eed commit 56cd2b1

File tree

1 file changed

+45
-20
lines changed

1 file changed

+45
-20
lines changed

bin/setup_teams_call.sh

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,54 @@ log() {
44
echo "--> $@ <--"
55
}
66

7-
# quit all, to be sure
8-
log "Killing Teams and OBS studio"
9-
flatpak kill com.microsoft.Teams || true
10-
flatpak kill com.obsproject.Studio || true
7+
stop_all() {
8+
log "Stop Teams and OBS studio"
9+
flatpak kill com.microsoft.Teams || true
10+
flatpak kill com.obsproject.Studio || true
1111

12-
log "Reloading NoiseTorch"
13-
# unload noise torch
14-
noisetorch -u
15-
noisetorch -i
12+
log "Stopping Android Webcam"
13+
systemctl --user stop android-webcam
14+
}
15+
16+
if [ $# -ne 1 ]; then
17+
echo "Usage $0 on|off"
18+
exit 1
19+
fi
20+
21+
case "$1" in
22+
on)
23+
# stop all, to be sure
24+
stop_all
25+
26+
log "Checking if headset is connected"
27+
pactl list sinks | grep 'bluez_sink'
28+
29+
log "Reloading NoiseTorch"
30+
# unload noise torch
31+
noisetorch -u
32+
noisetorch -i
33+
34+
log "Setting up Android Webcam"
35+
systemctl --user start android-webcam
36+
37+
log "Waiting for Webcam to be set up"
38+
sleep 5
1639

17-
log "Setting up Android Webcam"
18-
systemctl --user stop android-webcam
19-
systemctl --user start android-webcam
40+
log "Starting up OBS studio"
41+
flatpak run com.obsproject.Studio --scene 'Scrum points' --startvirtualcam &
42+
sleep 5
2043

21-
log "Waiting for Webcam to be set up"
22-
sleep 5
44+
log "Launching Teams"
45+
flatpak run com.microsoft.Teams
46+
;;
47+
off)
48+
stop_all
49+
;;
50+
*)
51+
echo "Usage $0 on|off"
52+
exit 1
53+
;;
54+
esac
2355

24-
log "Starting up OBS studio"
25-
flatpak run com.obsproject.Studio --scene 'Scrum points' --startvirtualcam &
26-
sleep 5
2756

28-
log "Checking if headset is connected"
29-
pactl list sinks | grep 'bluez_sink'
3057

31-
log "Launching Teams"
32-
flatpak run com.microsoft.Teams

0 commit comments

Comments
 (0)