Skip to content

Commit 8ba9b05

Browse files
Merge pull request #82 from felipealfonsog/development
Development
2 parents 4689bd0 + 2850cf3 commit 8ba9b05

18 files changed

Lines changed: 3777 additions & 5 deletions

.DS_Store

-2 KB
Binary file not shown.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,63 @@
1515
[![Vim](https://img.shields.io/badge/--019733?logo=vim)](https://www.vim.org/)
1616
[![Visual Studio Code](https://img.shields.io/badge/--007ACC?logo=visual%20studio%20code&logoColor=ffffff)](https://code.visualstudio.com/)
1717

18+
🚀 **Excited to Present Version 1.0.4** 🚀
19+
20+
I am thrilled to announce version 1.0.4 of the Terminal Notes Utility! I'm going even further with exciting new features and improvements! 🎉
21+
22+
**Implemented Changes and Features:**
23+
24+
1. **Create Files**: Added `createFiles()` function to create the `term_notes` file in `~/.config` if it doesn't exist.
25+
26+
2. **Move Binary**: Implemented `moveBinaryToDestination()` to move the `term-notes` binary to `/usr/local/bin/` on Linux or `/usr/local/bin/` on macOS.
27+
28+
3. **Add Note**: Implemented `addNote()` function for adding a new note, storing its content in `notes.txt`, and providing options to edit it using `nano`, `vim`, or `neovim`.
29+
30+
4. **Edit Note**: Added `editNote()` function for editing an existing note, displaying a list of available notes, and choosing an editor (`nano`, `vim`, or `neovim`) to edit the selected note's content.
31+
32+
5. **Delete Note**: Implemented `deleteNote()` function to delete an existing note, showing a list of notes, and selecting one to delete.
33+
34+
6. **Delete All Notes**: Added `deleteAllNotes()` function to delete all existing notes from `notes.txt`.
35+
36+
7. **Show Note**: Implemented `showNote()` function for displaying the content of a specific note, requesting the note's ID, and showing its content if found.
37+
38+
8. **Show All Notes**: Added `showAllNotes()` function to display the content of all existing notes in `notes.txt`.
39+
40+
9. **Menus**: Created `showNotesMenu()` and `mainMenu()` functions to display the available options for managing notes and the main menu, respectively.
41+
42+
10. **Additional Settings**: Set appropriate permissions to make the generated binary executable (`chmod`).
43+
44+
**Call for Collaboration 🤝**
45+
46+
I am open to collaborating with engineers and developers on this project. Working together could lead to significant learning opportunities for all involved. If you are interested in contributing to the Terminal Notes Utility, feel free to reach out and join the team!
47+
48+
#### Changes Made for macOS and Linux Separation
49+
50+
To achieve compatibility with both macOS and Linux, the original term_notes.c file has been split into two separate files: term_notes_macos.c and term_notes_linux.c. This separation was necessary to address platform-specific system calls, dependencies, and path handling.
51+
52+
- term_notes_mac.c
53+
The term_notes_macos.c file includes code that is specific to macOS. This version of the utility uses platform-specific libraries and functions for path handling, file management, and other system calls to ensure seamless execution on macOS.
54+
55+
- term_notes_linux.c
56+
The term_notes_linux.c file contains code tailored to work on Linux systems. Similar to the macOS version, this file uses Linux-specific libraries and functions for path handling, file management, and other system interactions.
57+
58+
#### Compiling and Running the Utility
59+
60+
To compile the Notes Manager on macOS, use the following command:
61+
62+
```
63+
gcc -o term-notes-macos src/term_notes_mac.c
64+
```
65+
66+
And for Linux, use:
67+
68+
```
69+
gcc -o term-notes-linux src/term_notes_linux.c
70+
```
71+
72+
**Let's make note-taking from the terminal even better!** 📝
73+
74+
1875
![Screenshot of the Term Notes application interface](imgs/sshot_termnotes.jpg)
1976

2077
## Term-Notes Installer 🚀
@@ -31,6 +88,9 @@ Hey there! 👋 I'm excited to share that I successfully created a convenient Ba
3188

3289
By the way, we had some hurdles along the way. Homebrew didn't accept our project, but screw it! 😄 We persevered and made it happen, developing an easy-to-use installer with some cool ASCII ART!
3390

91+
#### UPDATES: Modification for macOS and Linux
92+
The original script was enhanced to determine the user's operating system and download the appropriate C source file for compilation. The modification ensures that the Term-Notes utility is compiled with the correct C source file depending on the operating system.
93+
3494
#### To Install it:
3595
To install Term-Notes, simply run the installer script available [here](https://github.com/felipealfonsog/TermNotes/raw/main/installer.sh).
3696

@@ -119,6 +179,7 @@ For users on other Linux distributions and macOS, don't worry! You can still com
119179
#### Prerequisites
120180

121181
- GCC (GNU Compiler Collection)
182+
- libutil-linux
122183
- Nano or Vim text editor
123184

124185
#### Compiling the Source Code
@@ -133,6 +194,12 @@ git clone https://github.com/felipealfonsog/TermNotes.git
133194
```
134195
cd TermNotes/src
135196
```
197+
4. Install Libutil-linux
198+
199+
```
200+
sudo pacman -S libutil-linux
201+
```
202+
136203
4. Compile the source code:
137204

138205
```

imgs/.DS_Store

0 Bytes
Binary file not shown.

imgs/IMG_3762.HEIC

1.64 MB
Binary file not shown.
89.8 KB
Loading

installer.sh

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ echo "
3030
║ Chile ║
3131
║ ║
3232
║ Contact: f.alfonso@res-ear.ch ║
33-
║ Licensed under GNU/GPL and MIT
33+
║ Licensed under MIT
3434
║ GitHub: github.com/felipealfonsog ║
3535
║ LinkedIn: ║
3636
║ linkedin.com/in/felipealfonsog ║
@@ -138,16 +138,36 @@ elif [[ $(uname) == "Linux" ]]; then
138138
fi
139139

140140

141-
curl -o term_notes.c https://raw.githubusercontent.com/felipealfonsog/TermNotes/main/src/term_notes.c
141+
142+
if [[ $(uname) == "Darwin" ]]; then
143+
source_file_url="https://raw.githubusercontent.com/felipealfonsog/TermNotes/main/src/term_notes_mac.c"
144+
source_file_name="term_notes_mac.c"
145+
elif [[ $(uname) == "Linux" ]]; then
146+
source_file_url="https://raw.githubusercontent.com/felipealfonsog/TermNotes/main/src/term_notes_linux.c"
147+
source_file_name="term_notes_linux.c"
148+
else
149+
echo "Unsupported operating system. Please install manually, read documentation, and re-run the installer."
150+
exit 1
151+
fi
152+
153+
154+
curl -o "$source_file_name" "$source_file_url"
155+
156+
157+
gcc -o term-notes "$source_file_name"
158+
159+
160+
161+
162+
# curl -o term_notes.c https://raw.githubusercontent.com/felipealfonsog/TermNotes/main/src/term_notes.c
142163

143164
# Compile the program and rename it to term-notes
144-
gcc -o term-notes term_notes.c
165+
# gcc -o term-notes term_notes.c
145166

146167

147168
if [[ $(uname) == "Darwin" ]]; then
148169
sudo mv term-notes /usr/local/bin/
149170

150-
# Check if executable permissions need to be set on macOS
151171
if [[ ! -x /usr/local/bin/term-notes ]]; then
152172
sudo chmod +x /usr/local/bin/term-notes
153173
fi

src/.DS_Store

0 Bytes
Binary file not shown.

src/FirstSetup/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void createDirectories() {
9999
}
100100

101101
void installDependencies() {
102-
// Verificar e instalar dependencias (Vim, Nano)
102+
103103
const char* vimCommand = "which vim > /dev/null";
104104
const char* nanoCommand = "which nano > /dev/null";
105105

src/bugs.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-Bug in Ach Linux:
2+
[felipe@SDFCSC src]$ gcc -o term-notes term_notes.c
3+
term_notes.c:57:10: fatal error: libproc.h: No such file or directory
4+
57 | #include <libproc.h>
5+
| ^~~~~~~~~~~
6+
compilation terminated.
7+
8+

src/notes.txt

728 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)