summaryrefslogtreecommitdiffstats
path: root/2022/organizers-notebook/index.org
diff options
context:
space:
mode:
authorLeo Vivier <zaeph@zaeph.net>2022-10-21 17:24:45 +0200
committerLeo Vivier <zaeph@zaeph.net>2022-10-21 17:24:45 +0200
commitf2df64db7df3325af25708f8cde5773ab4499daa (patch)
treebc890968524c0beb68b9883683c813ff9c641501 /2022/organizers-notebook/index.org
parent77349d924e95ba1ebb4124a8cbb76eb6f532c9ec (diff)
downloademacsconf-wiki-f2df64db7df3325af25708f8cde5773ab4499daa.tar.xz
emacsconf-wiki-f2df64db7df3325af25708f8cde5773ab4499daa.zip
Add watch script for prerecs
Diffstat (limited to '2022/organizers-notebook/index.org')
-rw-r--r--2022/organizers-notebook/index.org47
1 files changed, 47 insertions, 0 deletions
diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org
index 68abe0e6..0a31aced 100644
--- a/2022/organizers-notebook/index.org
+++ b/2022/organizers-notebook/index.org
@@ -3376,6 +3376,53 @@ Throw an error if ERROR is non-nil, skip otherwise."
(message "Back to safety. Phew!")
#+end_src
+** Prerecs
+*** Receive notification when new prerecs are available
+#+begin_src sh :eval no :tangle prerecs-wait-new.sh
+#!/usr/bin/env sh
+
+set -xeu
+
+sleep_duration=1800
+
+data=prerec-wait-new.data
+touch check-new-prerecs.data
+
+prerecs_number_current="$(TERM=xterm ssh orga@media.emacsconf.org -- ls -1 /srv/upload | wc -l)"
+
+plural() {
+ if [ "$2" = 1 ] || [ "$2" = -1 ]; then
+ echo "${1}"
+ else
+ case $1 in
+ "is" )
+ "are"
+ ;;
+ * )
+ "${1}s"
+ esac
+ fi
+}
+
+notify() {
+ echo "$1"
+ notify-send -t 0 "EmacsConf" "$1"
+}
+
+prerecs_number_past=$(cat check-new-prerecs.data)
+diff=$((prerecs_number_current - prerecs_number_past))
+
+echo "Currently waiting for prerec"
+
+while [ $diff = 0 ]; do
+ sleep "$sleep_duration"
+done
+
+notify "Yay~, $diff new $(plural "prerec" $diff) $(plural "is" $diff) available!"
+
+echo "$prerecs_number_current" > "$data"
+#+end_src
+
** Publish this page
#+begin_src emacs-lisp