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 \
|
2022-04-29 16:50:34 +00:00
|
|
|
--only-tasks \
|
2022-03-26 22:15:06 +00:00
|
|
|
--append-project-id-to-task \
|
|
|
|
| fuzzel-run \
|
|
|
|
--dmenu
|
|
|
|
)"
|
|
|
|
|
2022-04-29 16:50:34 +00:00
|
|
|
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"
|