From 93c1543c5d46b5491a280657dfca0b3b5962252f Mon Sep 17 00:00:00 2001 From: Ogbonna Henry Date: Fri, 4 Sep 2026 00:00:27 +0100 Subject: [PATCH] Add omarchy-install-blesh for opt-in ble.sh autocompletion --- bin/omarchy-install-blesh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/omarchy-install-blesh diff --git a/bin/omarchy-install-blesh b/bin/omarchy-install-blesh new file mode 100755 index 0000000000..74972b2a2f --- /dev/null +++ b/bin/omarchy-install-blesh @@ -0,0 +1,23 @@ +#!/bin/bash + +# omarchy:summary=Install ble.sh for enhanced bash autocompletion and line editing + +echo "Installing ble.sh..." +omarchy-pkg-aur-add blesh-git + +# Source ble.sh from the user's bashrc so interactive shells get syntax +# highlighting, autosuggestions, and menu completion. The grep keeps this +# idempotent across repeated runs. +if ! grep -q 'share/blesh/ble.sh' ~/.bashrc 2>/dev/null; then + cat >>~/.bashrc <<'EOF' + +# Added by omarchy-install-blesh (https://github.com/akinomyoga/ble.sh) +if [[ $- == *i* && -r /usr/share/blesh/ble.sh ]]; then + source /usr/share/blesh/ble.sh + ble-bind -f 'TAB' 'menu-complete' + ble-bind -f 'S-TAB' 'menu-complete backward' +fi +EOF +fi + +echo "ble.sh installed. Restart your shell to activate it."