skynet/scripts/swaystatus.sh

18 lines
350 B
Bash
Executable File

#!/usr/bin/env bash
status=$(
if [ "$(timew get dom.active)" = "1" ]; then
echo -n '+'
else
echo -n '-'
fi
time=$(timew summary | tail -n2 | head -n1 | awk '{ print $1 }' | sed 's/:[0-9]\+$//')
if [ "$time" != "No" ]; then
echo -n "$time"
else
echo -n '0:00'
fi
echo -n ' | '
date +'%a %b %d %H:%M'
)
echo "$status"