Skip to content

Instantly share code, notes, and snippets.

@ShawnMilo
Created January 17, 2018 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShawnMilo/06c2242fa3df7b4001f2eabbeede66a3 to your computer and use it in GitHub Desktop.
Save ShawnMilo/06c2242fa3df7b4001f2eabbeede66a3 to your computer and use it in GitHub Desktop.
#!/bin/bash
STAMP=$(date "+%Y-%m")
SEP="--------------------------------------------------------------------------------"
FILE="/home/shawn/Documents/time_tracking/$STAMP"
# only have one copy open
if [ "$(pgrep -f $FILE)" ]; then
exit
fi
#preferred format for date stamp
STAMP=$(date "+%Y-%m-%d %H:%M:%S (%A)")
printf "\n$SEP\n$STAMP\n\n" >> $FILE
DISPLAY=:0 mousepad $FILE &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment