| Hash | Commit message | Author | Date | Files | + | - |
1 | commit ffc874cfa63f91e8efb9bd78fc4406a4730380ab |
2 | Author: Connor Etherington <[email protected]> |
3 | Date: Wed Sep 7 05:21:04 2022 +0200 |
4 | |
5 | Auto-Commit Update - 20220907 |
6 | --- |
7 | usr/bin/nav | 19 ++++++++----------- |
8 | 1 file changed, 8 insertions(+), 11 deletions(-) |
9 | |
10 | diff --git a/usr/bin/nav b/usr/bin/nav |
11 | index d94b9a6..b63e898 100755 |
12 | --- a/usr/bin/nav |
13 | +++ b/usr/bin/nav |
14 | @@ -47,8 +47,8 @@ ISCORRECT(){ |
15 | ISCORRECTMENU(){ |
16 | dialog \ |
17 | --title "${TITLE}" \ |
18 | - --yesno "\\nIs this correct?\\n\\nDirectory: ${1}\\n\\n\\nThis Directory will be added to the Nav Menu.\\n\\nThe Menu can be open with 'nav -m', or 'nav --menu'.\\n" \ |
19 | - 14 70 3>&1 1>&2 2>&3 3>&1 || $0 |
20 | + --yesno "\\nIs this correct?\\n\\nDirectory: ${1}\\n\\n\\nThis Directory will be added to the Nav Menu.\\n\\nThe Menu can be open with the 'navmenu' command.\\n" \ |
21 | + 15 70 3>&1 1>&2 2>&3 3>&1 || $0 |
22 | } |
23 | |
24 | INIT_CHECK(){ |
25 | @@ -87,13 +87,9 @@ MAIN(){ |
26 | [[ ${ACT} == 0 ]] && ISCORRECTMENU "${SELECTION}" && |
27 | echo `realpath ${SELECTION}` >> ${MENU_DIRS_FILE} |
28 | |
29 | - ${SHELL} |
30 | -} |
31 | + ${SHELL}[41m |
32 | |
33 | -MENU(){ |
34 | - goTo=$(cat ${MENU_DIRS_FILE} | uniq | fzf --preview 'ls -1a {}') |
35 | - cd ${goTo} && ls -1a |
36 | -} |
37 | +}[41m |
38 | |
39 | |
40 | # Script starts: |
41 | @@ -101,11 +97,12 @@ MENU(){ |
42 | |
43 | ! [ -d ${PROD_DIR} ] && mkdir -p ${PROD_DIR} |
44 | |
45 | -! [ -f ${CONFIG} ] && echo 'export NAV_INIT="initialized"' > ${CONFIG} |
46 | - |
47 | +! [ -f ${CONFIG} ] && echo -e 'export NAV_INIT="initialized" |
48 | +navmenu(){ goto=$(cat ${XDG_CONFIG_HOME:-$HOME/.config}/nav/menuDirs| |
49 | + uniq|fzf --preview "ls -1a {}");[[ -n ${goto} ]] && cd ${goto} && ls -1a\n}\n' > ${CONFIG} |
50 | |
51 | INIT_CHECK && case $1 in |
52 | - '-m'|'--menu'|'m'|'menu') MENU ; zsh --autocd 2>/dev/null ;; |
53 | + '-m'|'--menu'|'m'|'menu') navmenu ;; |
54 | *) MAIN ;; |
55 | esac |
56 | |