diff --git a/README.md b/README.md index f6afaf5..c6390f4 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ mo --version # Show installed version - Preview the cleanup by running `mo clean --dry-run` and reviewing the list. - Use `mo clean --whitelist` to manage protected caches. - Use `mo touchid` to approve sudo with Touch ID instead of typing your password. +- Prefer Vim-style navigation? All menus understand `h/j/k/l` in addition to the arrow keys. ## Features in Detail diff --git a/bin/analyze-go b/bin/analyze-go index 5cda9c4..7129645 100755 Binary files a/bin/analyze-go and b/bin/analyze-go differ diff --git a/cmd/analyze/main.go b/cmd/analyze/main.go index a6315cb..ed54f7d 100644 --- a/cmd/analyze/main.go +++ b/cmd/analyze/main.go @@ -578,17 +578,12 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) { m.offset = m.selected - viewport + 1 } } - case "enter": + case "enter", "right", "l": if m.showLargeFiles { return m, nil } return m.enterSelectedDir() - case "right": - if m.showLargeFiles { - return m, nil - } - return m.enterSelectedDir() - case "b", "left": + case "b", "left", "h": if m.showLargeFiles { m.showLargeFiles = false return m, nil @@ -640,7 +635,7 @@ func (m model) updateKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) { *m.currentPath = "" } return m, tea.Batch(m.scanCmd(m.path), tickCmd()) - case "l": + case "L": m.showLargeFiles = !m.showLargeFiles if m.showLargeFiles { m.largeSelected = 0 diff --git a/lib/common.sh b/lib/common.sh index b3eb5fb..370f50e 100755 --- a/lib/common.sh +++ b/lib/common.sh @@ -286,7 +286,11 @@ read_key() { $'\n' | $'\r') echo "ENTER" ;; ' ') echo "SPACE" ;; 'q' | 'Q') echo "QUIT" ;; - 'h' | 'H') echo "HELP" ;; + 'h') echo "LEFT" ;; + 'j') echo "DOWN" ;; + 'k') echo "UP" ;; + 'l') echo "RIGHT" ;; + 'm' | 'M') echo "MORE" ;; 'v' | 'V') echo "VERSION" ;; 't' | 'T') echo "TOUCHID" ;; 'u' | 'U') echo "UPDATE" ;; diff --git a/lib/menu_paginated.sh b/lib/menu_paginated.sh index 14612fc..2578c6b 100755 --- a/lib/menu_paginated.sh +++ b/lib/menu_paginated.sh @@ -733,9 +733,6 @@ paginated_multi_select() { restore_terminal return 0 ;; - "HELP") - # Removed help screen, users can explore the interface - ;; esac # Drain any accumulated input after processing (e.g., mouse wheel events) diff --git a/lib/menu_simple.sh b/lib/menu_simple.sh index 17420a2..83135e0 100755 --- a/lib/menu_simple.sh +++ b/lib/menu_simple.sh @@ -216,23 +216,6 @@ paginated_multi_select() { printf "${clear_line}" >&2 } - # Show help screen - show_help() { - printf "\033[H\033[J" >&2 - cat >&2 << EOF -Help - Navigation Controls -========================== - - ${ICON_NAV_UP} / ${ICON_NAV_DOWN} Navigate up/down - Space Select/deselect item - Enter Confirm selection - Q / ESC Exit - -Press any key to continue... -EOF - read -n 1 -s >&2 - } - # Main interaction loop while true; do draw_menu @@ -294,7 +277,6 @@ EOF selected[i]=false done ;; - "HELP") show_help ;; "ENTER") # Store result in global variable instead of returning via stdout local -a selected_indices=() diff --git a/mole b/mole index 5f0084c..7ee0a35 100755 --- a/mole +++ b/mole @@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/lib/common.sh" # Version info -VERSION="1.10.8" +VERSION="1.10.9" MOLE_TAGLINE="can dig deep to clean your Mac." # Check if Touch ID is already configured @@ -534,7 +534,7 @@ show_main_menu() { if [[ -t 0 ]]; then printf '\r\033[2K\n' # Show TouchID if not configured, otherwise show Update - local controls="${GRAY}↑↓ | Enter | H Help | " + local controls="${GRAY}↑↓ | Enter | M More | " if ! is_touchid_configured; then controls="${controls}T TouchID" else @@ -632,7 +632,7 @@ interactive_main_menu() { show_cursor exec "$SCRIPT_DIR/bin/status.sh" ;; - "HELP") + "MORE") show_cursor clear show_help