SHELL = /bin/bash
PROG = odot
-PREFIX ?= /usr
-BINDIR ?= $(PREFIX)/bin
-SHAREDIR ?= $(HOME)/.local/share
+BINDIR ?= /bin
+STATEDIR ?= $(HOME)/.local/state
install : main.c
sudo gcc main.c -o '$(BINDIR)/$(PROG)'
- [[ ! -d '$(SHAREDIR)/$(PROG))' ]] && mkdir -p '$(SHAREDIR)/$(PROG)'
+ [[ ! -d '$(STATEDIR)/$(PROG))' ]] && mkdir -p '$(STATEDIR)/$(PROG)'
clean :
- rm -rf '$(SHAREDIR)/$(PROG)'
+ rm -rf '$(STATEDIR)/$(PROG)'
# odot
Todo manager written in C
-Usage:
+Extremely basic to use, simply call ***odot*** with a task to add or
+remove it from the list, or call ***odot*** all by iteself to see the
+current todo list in alphabetical order.
- Add new task to list:
+* Usage:
+
+ - Add new task to list:
- $ odot [new task not on list]
+ $ odot [new task not on list]
+
+ - Remove task from list:
- Remove task from list:
-
- $ odot [task already on list]
+ $ odot [task already on list]
- Show list:
+ - Show list:
- $ odot
+ $ odot
-Installation:
+* Installation:
+
+ $ git clone https://github.com/huboles/odot.git
+ $ cd odot
+ $ make install
+
+***odot*** stores current and completed tasks in plaintext .txt files, located at
+$HOME/.local/share/odot.
- $ git clone https://github.com/huboles/odot.git
- $ cd odot
- $ sudo gcc *.c -o /usr/bin/odot
- $ mkdir $HOME/.local/state/odot
extern char *tmp;
char *homedir = getenv("HOME");
- list = strcat(homedir,"/.local/share/odot/todo.txt");
- done = strcat(homedir,"/.local/share/odot/done.txt");
- tmp = strcat(homedir,"/.local/share/odot/tmp.txt");
+
+ list = malloc((strlen(homedir)+22)*sizeof(char));
+ done = malloc((strlen(homedir)+22)*sizeof(char));
+ tmp = malloc((strlen(homedir)+21)*sizeof(char));
+
+ sprintf(list,"%s/.local/state/odot/todo.txt",homedir);
+ sprintf(done,"%s/.local/state/odot/done.txt",homedir);
+ sprintf(tmp,"%s/.local/state/odot/tmp.txt",homedir);
if (argc == 1){
show();
} else {
addnote(getnote(argc,argv));
}
+
+ free(tmp);
+ free(done);
+ free(list);
return 0;
}