-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script calculating how much time I worked in terminal
- Loading branch information
Leonid Beynenson
authored and
Leonid Beynenson
committed
Mar 23, 2015
1 parent
b349b94
commit 35849fc
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
NUM_LINES_WITH_TERMINAL=$(cat $(winnamelog) | grep "^[0-9_-]\+\sgnome-terminal.Gnome-terminal" | grep -v "^[0-9_-]\+\sgnome-terminal.Gnome-terminal\s*leonid@leonid-pc: ~$" | wc -l) | ||
NUM_LINES_WITH_TERMINAL=$(( $NUM_LINES_WITH_TERMINAL )) | ||
TIMEOUT=15 | ||
NUM_MINUTES_WITH_TERMINAL=$(( $NUM_LINES_WITH_TERMINAL / (60 / $TIMEOUT) )) | ||
|
||
TIME_WITH_TERMINAL_H=$(( $NUM_MINUTES_WITH_TERMINAL / 60 )) | ||
TIME_WITH_TERMINAL_M=$(( $NUM_MINUTES_WITH_TERMINAL - $TIME_WITH_TERMINAL_H * 60 )) | ||
|
||
echo "Total time in terminal = $NUM_MINUTES_WITH_TERMINAL min = $TIME_WITH_TERMINAL_H h $TIME_WITH_TERMINAL_M min" | ||
|