2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
9 # Copyright 2024 Ian Kelling
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
15 # http://www.apache.org/licenses/LICENSE-2.0
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
23 set -e; .
/usr
/local
/lib
/bash-bear
; set +e
26 p
=$
(cat /p
/obs-ws-pass
)
27 if [[ -e /tmp
/no-obs-auto-scene-switch
]]; then
28 rm -f /tmp
/no-obs-auto-scene-switch
29 if [[ -s /tmp
/last-obs-i3-mark
]]; then
30 mark
=$
(cat /tmp
/last-obs-i3-mark
)
31 obs-cmd
-w obsws
://localhost
:4455/$p scene switch
$mark
34 touch /tmp
/no-obs-auto-scene-switch
35 obs-cmd
-w obsws
://localhost
:4455/$p scene switch interlude
41 f
=/tmp
/iank-ffmpeg-interlude-toggle
47 # note: get _6 from looking for "parsed" ffmpeg debug output.
48 zsend
-b tcp
://127.0.0.1:5557 Parsed_drawbox_6 t
0
49 zsend
-b tcp
://127.0.0.1:5557 Parsed_drawtext_7 reinit
"text=''"
53 # I started an attempt to track if I was muted before an interlude,
54 # but decided against it. Seems easier to handle unmuting with
55 # whatever normal process I have for it.
57 # muted=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}')
59 zsend Parsed_volume_1 volume
0
60 zsend
-b tcp
://127.0.0.1:5557 Parsed_drawbox_6 t fill
61 zsend
-b tcp
://127.0.0.1:5557 Parsed_drawtext_7 reinit
"text='$(date "+%H\
:%M
%Z
") - Be right back'"
68 if [[ $1 == -b ]]; then
72 out
=$
(printf "%s\n" "$*" | zmqsend
${zmq_args[@]} ||
:)
73 if [[ $out != "0 Success" ]]; then
74 i3-nagbar
-m "FAILED zmqsend: $*" -t error
-f "pango:monospace 30"
82 # if pgrep '^obs$' &>/dev/null; then