Skip to content

Commit

Permalink
Add ability to set a preferred print tool other than cat
Browse files Browse the repository at this point in the history
  • Loading branch information
dcchambers committed Mar 31, 2021
1 parent cae86fd commit 806898b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ The following variables can be set to overwrite Notekeeper defaults:

* `NOTE_NAME`
* Default is `$YEAR-$MONTH-$DAY.md`

# `PRINT_TOOL`
* Default is `cat`
3 changes: 2 additions & 1 deletion note
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DAY=$(date +'%d')
# Set default configuration
NOTE_DIR="$HOME/notes"
NOTE_NAME="$YEAR-$MONTH-$DAY.md"
PRINT_TOOL="cat"

# Overwrite configs from noterc configuration file
NOTERC="${XDG_CONFIG_HOME:-$HOME/.config}/notekeeper/noterc"
Expand Down Expand Up @@ -114,7 +115,7 @@ else
fi

if [ "$printNoteOnly" = true ]; then
cat "$NOTE_DIR/$NOTE_NAME"
$PRINT_TOOL "$NOTE_DIR/$NOTE_NAME"
exit 0
fi

Expand Down

0 comments on commit 806898b

Please sign in to comment.