Skip to content

Manual A1 Installation

Kyle Beechly edited this page Apr 17, 2025 · 26 revisions

[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc | Index]

A1. Installation

Arch Linux (AUR)

blesh-git (devel)

# With makepkg
git clone https://aur.archlinux.org/blesh-git.git
cd blesh-git
makepkg -fsi

# With yay
yay -S blesh-git

# With paru
paru -S blesh-git

# With pacaur
pacaur -S blesh-git

# With pikaur
pikaur -S blesh-git

# With pakku
pakku -S blesh-git

# With yaourt
yaourt -S blesh-git

# With aurman
aurman -S blesh-git

# With trizen
trizen -S blesh-git

# With aura
sudo aura -Ax blesh-git

blesh (stable)

# With makepkg
git clone https://aur.archlinux.org/blesh.git
cd blesh
makepkg -fsi

# With yay
yay -S blesh

# With paru
paru -S blesh

# With pacaur
pacaur -S blesh

# With pikaur
pikaur -S blesh

# With pakku
pakku -S blesh

# With yaourt
yaourt -S blesh

# With aurman
aurman -S blesh

# With trizen
trizen -S blesh

# With aura
sudo aura -A blesh

Nix (nixpkgs)

blesh

There are many ways to install blesh in Nix: via a temporary Nix shell, via Home Manager, in NixOS via configuration.nix, and more. Choose your favorite!

Note for all options

This config can be skipped if it is added in Home Manager instead.

blesh package provides blesh-share executable, which echoes the directory path in which ble.sh is installed. You can use it to configure ble.sh in your ~/.bashrc:

# ~/.bashrc
source "$(blesh-share)"/ble.sh --attach=none # does not work currently
...
[[ ! ${BLE_VERSION-} ]] || ble-attach

Try in a Nix shell

Use nix-shell to try blesh in a temporary shell:

$ nix-shell -p blesh

Make sure to restart bash from within the new Nix shell:

$ bash

Install with home-manager

Note that these instructions are written in Flake syntax, though they will likely work without Flakes if the syntax is changed accordingly.

Option 1: Packages
{pkgs, ...}: {
  home.packages = with pkgs; [
    blesh
  ];
  programs.bash = {
    enable = true;
    bashrcExtra = ''
      [[ $- == *i* ]] && source "$(blesh-share)"/ble.sh --noattach
      ...
      [[ ! ''${BLE_VERSION-} ]] || ble-attach
    '';
  };
}
Option 2: Programs

[ToDo: Waiting for home-manager#3238 to be merged]

Home-manager automatically configures ble.sh. The minimum configuration is as follows:

{pkgs, ...}: {
  programs.bash.enable = true;
  programs.blesh.enable = true;
}

You can configure ble.sh options in a manner of home-manager:

{pkgs, ...}: {
  programs.blesh = {
    enable = true;
    options = {
      prompt_ps1_transient = "trim:same-dir";
      prompt_ruler = "empty-line";
    };
    blercExtra = ''
      function my/complete-load-hook {
        bleopt complete_auto_history=
        bleopt complete_ambiguous=
        bleopt complete_menu_maxlines=10
      };
      blehook/eval-after-load complete my/complete-load-hook
    '';
  };
}

See home-manager's documentation for any other options available.

Install via NixOS config

Note that these instructions are written in Flake syntax, though they will likely work without Flakes if the syntax is changed accordingly.

Add the following to configuration.nix:

{pkgs, ...}: {
  environment.systemPackages = with pkgs; [
    blesh
  ];
}

Install via nix-env (not recommended)

You can also use nix-env to install blesh.

Warning: Using nix-env permanently modifies a local profile of installed packages. This must be updated and maintained by the user in the same way as with a traditional package manager, foregoing many of the benefits that make Nix uniquely powerful. Using a temporary Nix shell or a Home Manager or NixOS configuration is recommended instead.

On NixOS:
$ nix-env -iA nixos.blesh
On non-NixOS:

With Flakes:

$ nix profile install nixpkgs#blesh

Without Flakes:

$ nix-env -iA nixpkgs.blesh

[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc | Index]

Clone this wiki locally