diff options
Diffstat (limited to '')
-rwxr-xr-x | pkgs/by-name/ne/neorg/main.sh | 189 |
1 files changed, 0 insertions, 189 deletions
diff --git a/pkgs/by-name/ne/neorg/main.sh b/pkgs/by-name/ne/neorg/main.sh deleted file mode 100755 index b4f0f0e6..00000000 --- a/pkgs/by-name/ne/neorg/main.sh +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - -# load dependencies -. ./functions/add.sh -. ./functions/context.sh -. ./functions/dmenu.sh -. ./functions/f_start.sh -. ./functions/f_stop.sh -. ./functions/inputs.sh -. ./functions/list.sh -. ./functions/project.sh -. ./functions/review.sh -. ./functions/utils.sh -. ./functions/workspace.sh - -# these are used in version() -# shellcheck disable=2034 -AUTHORS="Soispha" -# shellcheck disable=2034 -YEARS="2023" - -NAME="neorg" - -help() { - cat <<EOF -This is the core interface to the system-integrated task management - -USAGE: - $NAME [OPTIONS] [COMMAND] - -OPTIONS: - --help | -h - Display this help and exit. - - --version | -v - Display version and copyright information and exit. -COMMANDS: - task [ID] - Open the neorg context associated with the current context and - the uuid of the task with id ID. Without ID, it'll open the - current context's norg file. - If no context is set, drops you to the selection prompt - - dmenu - Select a project in dmenu mode. This will give you all projects - and exectute the selected one as in 'neorg projects <selected>' - - workspace [WS] - The neorg workspace (WS) to open at startup, an empty value drops - you at a prompt to enter the workspace yourself. - - project [P] - Opens the webbrowser with either the context (P) or - the current active context as argument if no context is supplied - - list - Lists all available contexts - - add - Allows you to quickly add projects - - fstart ID - Starts the task (ID) but only after it stooped - the previous active task, if it existed. - - fstop - Stops the current active task - - review - Review all firefox tabs - - inputs_add F - Add all urls from the file F as inputs to be catogorized - - inputs_review P - Like 'review', but for the inputs that have previously been added. - It takes a project in which to open the urls. -ARGUMENTS: - ID | *([0-9]) := [[%ID_GENERATION_FUNCTION]] - The function displays all possible IDs of the eligable tasks. - - WS := %ALL_WORKSPACES - All possible workspaces. - - P := %ALL_PROJECTS_PIPE - The possible project. - - F := [[fd . --max-depth 3]] - A URL-Input file to use as source. - -EOF -} - -for arg in "$@"; do - case "$arg" in - "--help" | "-h") - help - exit 0 - ;; - "--version" | "-v") - version - exit 0 - ;; - esac -done - -while [ "$#" -ne 0 ]; do - case "$1" in - "t"*) # task - shift 1 - task_id="$1" - [ "$task_id" ] || utils0chain context0open_current_task_context "exit 0" - context0open_current_task_context_at_task_id "$task_id" - exit 0 - ;; - "w"*) # workspace - shift 1 - workspace_to_open="$1" - # TODO: Exit with 1 on error, instead of the 0 <2023-10-20> - [ "$workspace_to_open" ] || utils0chain workspace0open_neorg_workspace_prompt "exit 0" - workspace0open_neorg_workspace "$workspace_to_open" - exit 0 - ;; - "p"*) # project - shift 1 - project_to_open="$1" - # TODO: Exit with 1 on error, instead of the 0 <2023-10-20> - [ "$project_to_open" ] || utils0chain project0open_current_context_in_browser "exit 0" - if ! grep -q "$project_to_open" "$(ptmp "%ALL_PROJECTS_NEWLINE")"; then - die "Your project ('$project_to_open') is not in the list of available projects: -%ALL_PROJECTS_COMMA" - fi - project0open_project_in_browser "$project_to_open" - exit 0 - ;; - "l"*) # list - list0list_all_contexts_newline - exit 0 - ;; - "a"*) # add-project - add0open_taskwarrior_project_file - exit 0 - ;; - "d"*) # dmenu - dmenu0open_context_in_browser - exit 0 - ;; - "fsta"*) # fstart - shift 1 - task_id="$1" - [ "$task_id" ] || die "No task id provided to fstart" - fstart0start_new_task "$task_id" - exit 0 - ;; - "fsto"*) # fstop - fstop0stop_current_task - exit 0 - ;; - "r"*) # review - shift 1 - review0start - exit 0 - ;; - "inputs_a"*) # inputs_add - shift 1 - url_file="$1" - [ -f "$url_file" ] || die "Url file ('$url_file') is not a valid file." - inputs0add "$url_file" - exit 0 - ;; - "inputs_r"*) # inputs_review - shift 1 - base_project="$1" - [ -z "$base_project" ] && die "'inputs_review' requires a project." - inputs0review "$base_project" - exit 0 - ;; - *) - die "Command '$1' does not exist! Please look at:\n $NAME --help" - exit 0 - ;; - esac -done - -context0open_current_task_context -# vim: ft=sh |