summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-06-07 08:46:01 +0200
committerlassulus <lassulus@lassul.us>2021-06-07 08:46:01 +0200
commitbb79bf0ae8aeb47c6f6c74bf205ca43c74d42213 (patch)
treeb3e32c66ee51b7862c29bcda1a1a324e58458834
parent9d5bedb40485c55eb125c29cd609d725aee2c40c (diff)
l radio: set irc topic
-rw-r--r--lass/2configs/radio.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix
index 528d12069..040f5b943 100644
--- a/lass/2configs/radio.nix
+++ b/lass/2configs/radio.nix
@@ -83,6 +83,17 @@ let
}'
'';
+ set_irc_topic = pkgs.writeDash "set_irc_topic" ''
+ ${pkgs.curl}/bin/curl -fsSv --unix-socket /home/radio/reaktor.sock http://z/ \
+ -H content-type:application/json \
+ -d "$(${pkgs.jq}/bin/jq -n \
+ --arg text "$1" '{
+ command:"TOPIC",
+ params:["#the_playlist",$text]
+ }'
+ )"
+ '';
+
write_to_irc = pkgs.writeDash "write_to_irc" ''
${pkgs.curl}/bin/curl -fsSv --unix-socket /home/radio/reaktor.sock http://z/ \
-H content-type:application/json \
@@ -203,7 +214,7 @@ in {
listeners=$(${pkgs.iproute}/bin/ss -Hno state established 'sport = :8000' | wc -l)
echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE"
echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE"
- ${write_to_irc} "playing: $track listeners: $listeners"
+ ${set_irc_topic} "playing: $track listeners: $listeners"
done
'';
in {