merging waybar configs with my old ones
This commit is contained in:
parent
93879b3ef7
commit
a4740d2dc0
11 changed files with 264 additions and 132 deletions
30
.config/sway/scripts/zeit.sh
Executable file
30
.config/sway/scripts/zeit.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env sh
|
||||
tracking=$(zeit tracking --no-colors)
|
||||
|
||||
case $1'' in
|
||||
'status')
|
||||
text=$(echo "$tracking" | sed -z 's/\n/\\n/g' | grep -q 'tracking' && echo "tracking" || echo "stopped")
|
||||
tooltip=$tracking'\r(zeit time tracker)'
|
||||
echo "{\"text\":\"$text\",\"tooltip\":\"$tooltip\",\"class\":\"$text\",\"alt\":\"$text\"}"
|
||||
;;
|
||||
'click')
|
||||
if echo "$tracking" | grep -q 'tracking'; then
|
||||
zeit finish
|
||||
else
|
||||
swaymsg exec \$zeit_list
|
||||
fi
|
||||
;;
|
||||
'track')
|
||||
input=$(cat -)
|
||||
task=$(echo $input | pcregrep -io1 '└── (.+) \[.+')
|
||||
project=$(echo $input | pcregrep -io1 '.+\[(.+)\]')
|
||||
|
||||
if [ "$task" = "" ] || [ "$project" = "" ]; then
|
||||
notify-send "You did not select a task!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
zeit track -p "$project" -t "$task"
|
||||
notify-send "Tracking $task in $project"
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue