From 7a7ce3a296b6d16503feedfa60f9ea790427dc6a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 23 Nov 2021 15:59:45 +0100 Subject: [PATCH] taskwarrior: Add tim alias for timewarrior `tim` is intended as a quick support alias for timewarrior. If invoked without any arguments, `tim` will print out a simple summary of all tasks accomplished (for the day by default). It will also print their ids for simple subsequent modification tasks. If, however, invoked with additional arguments, `tim` will pass anything along to timewarrior so anything happens as usual if invoked like this. Thus, `tim` functions as a quick look into the day's timesheet or a shorter alternative to the `timew` command. --- taskwarrior/.config/sh/alias.d/timewarrior.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 taskwarrior/.config/sh/alias.d/timewarrior.sh diff --git a/taskwarrior/.config/sh/alias.d/timewarrior.sh b/taskwarrior/.config/sh/alias.d/timewarrior.sh new file mode 100644 index 0000000..71590af --- /dev/null +++ b/taskwarrior/.config/sh/alias.d/timewarrior.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +if ! exist timew; then + return 1 +fi + +# invoking tim without arguments prints out timesheet summary +# with ids attached. +# otherwise tim passes through any arguments to timew +tim() { + if [ "$#" -eq 0 ]; then + timew summary :ids + else + timew "$@" + fi +}