From e441c81b9b8bf18c5cb7b5a8ad33fecfee3b658f Mon Sep 17 00:00:00 2001 From: speedie Date: Tue, 8 Aug 2023 21:51:01 +0200 Subject: [PATCH] Add FIFO example script --- spmenu_fifo.sh | 113 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100755 spmenu_fifo.sh diff --git a/spmenu_fifo.sh b/spmenu_fifo.sh new file mode 100755 index 0000000..66c8c50 --- /dev/null +++ b/spmenu_fifo.sh @@ -0,0 +1,113 @@ +#!/bin/sh + +spmenu -l 500 -g 1 -lf /tmp/f & + +printf "" > /tmp/f + +update() { + printf "update" > /tmp/spmenu.fifo + sleep "${1:-0.1}" +} + +printf "s" > /tmp/f + +update 0.1 + +printf "p" >> /tmp/f + +update 0.1 + +printf "m" >> /tmp/f + +update 0.1 + +printf "e" >> /tmp/f + +update 0.1 + +printf "n" >> /tmp/f + +update 0.1 + +printf "u" >> /tmp/f + +update 0.1 +update 0.1 + +cat << EOF > /tmp/f +AAAAAAA +EOF + +update 0.3 + +cat << EOF > /tmp/f + AAAAAAA +EOF + +update 0.3 + +cat << EOF > /tmp/f +AAAAAA AAAAAAA +EOF + +update 0.3 + +cat << EOF > /tmp/f + AAAAAA AAAAAAA +EOF + +update 0.3 +cat << EOF > /tmp/f +AAAAAA AAAAAA AAAAAAA +EOF +cat << EOF > /tmp/f +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +EOF + +printf "cool\n" >> /tmp/f + +update 0.3 + +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 +printf "a\n" >> /tmp/f +update 0.1 + +printf "Goodbye." > /tmp/f +update 0.1 + +sleep 1 + +printf "exit_0" > /tmp/spmenu.fifo