|
38 | 38 | SHREDCMD="rm"
|
39 | 39 | fi
|
40 | 40 |
|
41 |
| -# |
| 41 | +SPELLCHECK=`grep spelling $CONFIGFILE | cut -d'=' -f 2` |
| 42 | + |
| 43 | +spellcheck () { |
| 44 | + case ${SPELLCHECK} in |
| 45 | + aspell) |
| 46 | + SPELLINGCMD="aspell -x -c " |
| 47 | + ${SPELLINGCMD} ${notefile} |
| 48 | + ;; |
| 49 | + ispell) |
| 50 | + SPELLINGCMD="ispell -x " |
| 51 | + ${SPELLINGCMD} ${notefile} |
| 52 | + ;; |
| 53 | + none) |
| 54 | + ;; |
| 55 | + *) |
| 56 | + echo Invalid config option `grep "spellcheck" ${CONFIGFILE}` |
| 57 | + esac |
| 58 | +} |
| 59 | + |
| 60 | + |
42 | 61 | # initialise notes system
|
43 | 62 | #
|
44 | 63 |
|
@@ -91,6 +110,23 @@ create_config () {
|
91 | 110 | KEY="`gpg -K --with-colons | grep fpr | head -1 | tr -d 'fpr:::::::::' `"
|
92 | 111 | echo "KEY $KEY" > $CONFIGFILE
|
93 | 112 |
|
| 113 | + echo Do you want spellchecking enabled? |
| 114 | + echo "1) Use aspell" |
| 115 | + echo "2) Use ispell" |
| 116 | + echo "3) Do not spellcheck" |
| 117 | + read -p "Choose 1,2,or 3: " choosespell |
| 118 | + case $choosespell in |
| 119 | + 1) |
| 120 | + echo "spelling=aspell" >> $CONFIGFILE |
| 121 | + ;; |
| 122 | + 2) |
| 123 | + echo "spelling=ispell" >> $CONFIGFILE |
| 124 | + ;; |
| 125 | + *) |
| 126 | + echo "spelling=none" >> $CONFIGFILE |
| 127 | + ;; |
| 128 | + esac |
| 129 | + |
94 | 130 | echo Default config written:
|
95 | 131 | cat $CONFIGFILE
|
96 | 132 | }
|
@@ -165,7 +201,7 @@ note_add () {
|
165 | 201 | # create temporary note file
|
166 | 202 | $EDITOR "$notefile"
|
167 | 203 |
|
168 |
| - #aspell -c "$notefile" |
| 204 | + spellcheck |
169 | 205 |
|
170 | 206 | # encrypt note file
|
171 | 207 | $GPG -ear $KEY $GPG_OPTS "$notefile"
|
@@ -213,11 +249,13 @@ note_edit () {
|
213 | 249 | if [ -f "$notefile" ]; then
|
214 | 250 | gpg -d -o "${decrypted}" "${notefile}"
|
215 | 251 | ${EDITOR} "${decrypted}"
|
| 252 | + spellcheck |
216 | 253 | $GPG -ear $KEY $GPG_OPTS "${decrypted}"
|
217 | 254 | ${SHREDCMD} ${decrypted}
|
218 | 255 | elif [ -f "${notefile}.asc" ]; then
|
219 | 256 | gpg -d -o "${decrypted}" "${notefile}.asc"
|
220 | 257 | ${EDITOR} "${decrypted}"
|
| 258 | + spellcheck |
221 | 259 | $GPG -ear $KEY $GPG_OPTS "${decrypted}"
|
222 | 260 | ${SHREDCMD} ${decrypted}
|
223 | 261 | else
|
@@ -371,7 +409,7 @@ GPG encrypted notes system for BSD and Linux systems
|
371 | 409 |
|
372 | 410 | notes init initialise notes system
|
373 | 411 | notes config display config file
|
374 |
| - notes backup backup $NOTESDIR to GPG encrypted tar file |
| 412 | + notes backup backup $NOTESDIR to GPG encrypted tar file |
375 | 413 | notes newkey email change GPG key
|
376 | 414 | notes help show help
|
377 | 415 | notes version show version
|
|
0 commit comments