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