├── README.md ├── rofi-todo.sh └── screenshots ├── add-todo.png ├── added-todo.png ├── search-todo.png └── todos.png /README.md: -------------------------------------------------------------------------------- 1 | # rofi-todo.sh 2 | 3 | Minimal todo client for the [rofi](https://github.com/DaveDavenport/rofi) launcher. 4 | 5 | This project is a fork of: http://bijanebrahimi.github.io/blog/rofi-todo.html 6 | 7 | ![todo](screenshots/todos.png) 8 | 9 | 10 | 11 | # Installation 12 | 13 | ## i3wm 14 | 15 | Add this line to i3 config file. Change `Mod1+P` to the shortcut you want to invoke rofi-todo.sh with. 16 | 17 | ``` 18 | bindsym Mod1+P exec rofi -modi TODO:/path/to/rofi-todo/rofi-todo.sh -show TODO 19 | ``` 20 | 21 | 22 | # Usage 23 | 24 | ## Add TODOs 25 | 26 | To add a new todo just start the line with a `+` sign, then press Enter, for example: 27 | 28 | ![Add](screenshots/add-todo.png) 29 | 30 | 31 | You will see: 32 | 33 | ![added](screenshots/added-todo.png) 34 | 35 | 36 | ## Search TODOs 37 | 38 | To search through todos just start typing 39 | 40 | ![search](screenshots/search-todo.png) 41 | 42 | ## Mark TODOs as done 43 | 44 | Use up/down arrows or start typing to select the TODO you want to mark as done, then press Enter. 45 | 46 | 47 | **Note:** todos will be saved to a text file located at `~/.rofi_todos`. 48 | 49 | ### Save a copy of completed TODOs 50 | 51 | To save a copy of your completed TODO items, specify `DONE_FILE`, e.g.: 52 | 53 | **~/.profile** 54 | ``` 55 | export DONE_FILE=~/.rofi_todos_done 56 | ``` 57 | 58 | -------------------------------------------------------------------------------- /rofi-todo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TODO_FILE=~/.rofi_todos 3 | 4 | if [[ ! -a "${TODO_FILE}" ]]; then 5 | touch "${TODO_FILE}" 6 | fi 7 | 8 | function add_todo() { 9 | echo -e "`date +"%B %d %H:%M"` $*" >> "${TODO_FILE}" 10 | } 11 | 12 | function remove_todo() { 13 | if [[ ! -z "$DONE_FILE" ]]; then 14 | echo "${*}" >> "${DONE_FILE}" 15 | fi 16 | sed -i "/^${*}$/d" "${TODO_FILE}" 17 | } 18 | 19 | function get_todos() { 20 | echo "$(cat "${TODO_FILE}")" 21 | } 22 | 23 | if [ -z "$@" ]; then 24 | get_todos 25 | else 26 | LINE=$(echo "${@}" | sed "s/\([^a-zA-Z0-9]\)/\\\\\\1/g") 27 | LINE_UNESCAPED=${@} 28 | if [[ $LINE_UNESCAPED == +* ]]; then 29 | LINE_UNESCAPED=$(echo $LINE_UNESCAPED | sed s/^+//g |sed s/^\s+//g ) 30 | add_todo ${LINE_UNESCAPED} 31 | else 32 | MATCHING=$(grep "^${LINE_UNESCAPED}$" "${TODO_FILE}") 33 | if [[ -n "${MATCHING}" ]]; then 34 | remove_todo ${LINE_UNESCAPED} 35 | fi 36 | fi 37 | get_todos 38 | fi 39 | -------------------------------------------------------------------------------- /screenshots/add-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiodangelis/rofi-todo/5114d1dbe3ece003d7be6dbc8c3241418b62f85b/screenshots/add-todo.png -------------------------------------------------------------------------------- /screenshots/added-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiodangelis/rofi-todo/5114d1dbe3ece003d7be6dbc8c3241418b62f85b/screenshots/added-todo.png -------------------------------------------------------------------------------- /screenshots/search-todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiodangelis/rofi-todo/5114d1dbe3ece003d7be6dbc8c3241418b62f85b/screenshots/search-todo.png -------------------------------------------------------------------------------- /screenshots/todos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/claudiodangelis/rofi-todo/5114d1dbe3ece003d7be6dbc8c3241418b62f85b/screenshots/todos.png --------------------------------------------------------------------------------