dotfiles/scripts/timew.sh

13 lines
318 B
Bash
Raw Normal View History

#!/bin/sh
# get tracking data
tracking_data=$(timew | head -1)
# get last line, remove spaces and "total"
tracking_time=$(timew | tail -1 | sed 's/ //g' | sed s/.*[total]//)
if [[ $tracking_data == *"There is no active time"* ]]; then
echo "Not tracking anything"
else
echo "$tracking_data | $tracking_time"
fi