puntos/.local/bin/zeit-fuzzel

27 lines
578 B
Plaintext
Raw Permalink Normal View History

2022-03-26 22:15:06 +00:00
#!/bin/sh
# Forked from https://github.com/mrusme/zeit/blob/c07a40a3185091dda8ba9a3b81c1e017bfda609b/extras/zeit-waybar-wofi.sh
2022-03-27 17:59:12 +00:00
. ~/.profile
2022-03-26 22:15:06 +00:00
tracking="$(zeit tracking --no-colors)"
if echo "$tracking" | grep -q '^ ▶ tracking'; then
zeit finish
exit 0
fi
selection="$(zeit list \
--only-tasks \
2022-03-26 22:15:06 +00:00
--append-project-id-to-task \
| fuzzel-run \
--dmenu
)"
task="$(echo $selection | pcregrep -io1 '(.+) \[.+')"
2022-03-26 22:15:06 +00:00
project="$(echo $selection | pcregrep -io1 '.+\[(.+)\]')"
if test "$task" = "" || "$project" = ""; then
exit 1
fi
zeit track -p "$project" -t "$task"