From f9188428999bfc45658c8875eadf9a64f397bbd4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 24 Oct 2014 16:35:58 -0200 Subject: Enhancing timelog_window_title() --- timelog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/timelog b/timelog index 4dbbbc6..f3f753d 100755 --- a/timelog +++ b/timelog @@ -21,9 +21,9 @@ EDITOR=${EDITOR:=vi} # http://stackoverflow.com/questions/899609/gnu-screen-run-script-that-sends-commands-to-the-screen-session-it-is-being-run function timelog_window_title { if [ -n "$STY" ]; then - screen -p $WINDOW -X title $1 + screen -p $WINDOW -X title "$*" else - xtitle $1 + xtitle "$*" fi } @@ -79,21 +79,25 @@ function timelog_menu { exit 1 fi else - echo "Usage: $BASENAME [edit]" + echo "Usage: $BASENAME [group] [edit]" exit 1 fi } -# Run +# Run worklog for a given project function timelog_run { + # Set window title timelog_window_title "log: $GROUP" + # Set base folder if [ -d "$CODE/$GROUP" ] && [ ! -d "$BASE/$GROUP" ]; then BASE="$CODE" fi + # Ensure folder exist mkdir -p $BASE/$GROUP/worklog + # Run if [ ! -e "$BASE/$GROUP/worklog/projects" ]; then timelog_setup elif [ "$ACTION" == "edit" ]; then -- cgit v1.2.3