You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ACEjuice/.local/bin/acejuice-interval

35 lines
880 B

#!/bin/sh
set -e
__send_cmd () {
printf "%s %s\n" "$1" "$2" > "$NPIPE_OUT"
}
_pipe_dir="${XDG_RUNTIME_DIR:-/tmp/$(id -u)-runtime}/acejuice"
mkdir -p "$_pipe_dir"
NPIPE_OUT="$_pipe_dir/main.sock"
unset _pipe_dir
mkfifo "$NPIPE_IN" 2> /dev/null || printf "fifo already present\n"
cycle=0
while true; do
if [ $((cycle%4)) = 0 ]; then
__send_cmd ":SET netw" "$($HOME/.config/screen/bin/netinfo.sh --color lemonbar --icon nerd)"
__send_cmd ":SET cput" "$($HOME/.config/screen/bin/cputemp.sh --color lemonbar --icon nerd --unit)"
fi
if [ $((cycle%4)) = 0 ]; then
__send_cmd ":SET date" "$(date +'%a %d %b %H:%M')"
fi
if [ $((cycle%16)) = 0 ]; then
__send_cmd ":SET batt" "$($HOME/.config/screen/bin/battery.sh --color lemonbar --unit --icon nerd --symbols ascii)"
fi
cycle=$((cycle+1))
if [ $cycle = 1024 ]; then
cycle=0
fi
sleep 1
done