From 3d6550c31304c04dfb1887d9f1db0397eb92a8cc Mon Sep 17 00:00:00 2001 From: dmarakom6 Date: Mon, 7 Dec 2020 17:44:27 +0200 Subject: [PATCH] 1.1 Update Fixes: -Fixed bugs -Fixed not getting back to previous working directory -Fixed Problem with Home Folder Additions: -Added noteinfo(): You can now view info about a note, icluding lines, letters and characters! Updates: -Updated Help Page (help.txt) --- help | 1 + shellnotes.sh | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/help b/help index 74c0d24..b9d7a09 100644 --- a/help +++ b/help @@ -29,5 +29,6 @@ Tips: -Deleting notes using delnote won't send the files to Trash. They will be deleted forever, so don't store other files in your Notes folder. -Even if you don't have a Notes folder, shellnotes will make one for you. -No matter in which directory you are, shellnotes will work from everywhere - and when your done taking notes, you will get back on your previous working directory! + -If you want to check if shellnotes is working proprely, try typing "shellnotes" in the terminal! diff --git a/shellnotes.sh b/shellnotes.sh index ea479fa..5de2deb 100644 --- a/shellnotes.sh +++ b/shellnotes.sh @@ -15,7 +15,7 @@ fi -#opening a note (newnote will work as well, but this is a simpler one, and will create a new note if $notename doesn't exist) +#opening a note (It will create a new note if $notename is blank) function readnote() { dir="$(pwd)"; me="$(whoami)"; @@ -82,7 +82,7 @@ else fi -if [ $readquicknote == "y" ] || [ $readquicknote == "Y" ] || [ $readquicknote == "yes" ] || [ $readquicknote == "YES" ] || [ $readquicknote == "Yes" ]; then +if [[ $readquicknote == "y" ]] || [[ $readquicknote == "Y" ]] || [[ $readquicknote == "yes" ]] || [[ $readquicknote == "YES" ]] || [[ $readquicknote == "Yes" ]]; then clear; cd ~/Notes cat $notename; @@ -91,10 +91,10 @@ fi } -#like quicknote(), but it opens ubuntu's text-editor (gedit). +#writes notes using ubuntu's text-editor (gedit). function newnote() { -cd ~/Notes; dir="$(pwd)"; +cd ~/Notes; me="$(whoami)"; gedit; clear; @@ -105,9 +105,9 @@ echo "-----------------------------------"; #Delete notes from terminal function delnote() { + dir="$(pwd)"; cd ~/Notes me="$(whoami)"; - dir="$(pwd)"; read -p "Enter the name of the note you want to delete: " delete if [ -e $delete ]; then rm $delete @@ -129,7 +129,7 @@ function listnotes() { #Help for new users function shellnotes() { - if [[ $1 == "-v" ]]; then + if [[ $1 == "-v" ]]; then echo "Shellnotes version: 1.0" elif [[ $1 == "-r" ]]; then @@ -143,4 +143,17 @@ function shellnotes() { cd $dir; fi } +#Take info about a note +function noteinfo() { + dir="$(pwd)" + cd ~/Notes + read -p "Enter note name: " notename; + if [ -e $notename ]; then + wc $notename; + echo "(lines/words/chars/name)" +else + echo "That note doesn't exist." +fi +cd $dir +} #Shellnotes made by dmarakom6.