merging waybar configs with my old ones

This commit is contained in:
Mark Riedesel 2024-06-12 14:24:17 -05:00
parent 93879b3ef7
commit a4740d2dc0
11 changed files with 264 additions and 132 deletions

30
.config/sway/scripts/zeit.sh Executable file
View 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