Manual A1 Installation - akinomyoga/ble.sh GitHub Wiki

[ 日本語 | 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!

In addition to installation, the user must configure ble.sh in ~/.bashrc, where the user can use the blesh-share executable provided by the blesh package. blesh-share prints the directory path in which ble.sh is installed.

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

Tip

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

Option 1: 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

Option 2: Install via NixOS config

Add the following to configuration.nix:

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

Option 3: 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 3.1: Packages

Add the following to home.nix:

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

Option 3.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.

Option 4: 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.

Option 4.1: On NixOS

$ nix-env -iA nixos.blesh

Option 4.2: 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]

⚠️ **GitHub.com Fallback** ⚠️