Add mc config, lazygit/nerd-font installers, fzf/zoxide bash integration
- New mc package: seasons-winter16M skin (fixes washed-out file colors under the old default skin), arrow-key panel navigation, and Backspace bound as an alt key for CdParent (Double Commander-style parent-dir navigation). - setup.sh: install_lazygit and install_nerd_font helpers, since neither ships as an apt/PPA package on this distro anymore. - bash/.bashrc.omb: wire up fzf key-bindings and zoxide, drop the now- redundant bashmarks plugin, enable globstar, and widen history.
This commit is contained in:
@@ -11,6 +11,72 @@ stow_pkg() {
|
||||
stow -v -d "$DOTFILES_DIR" -t "$HOME" "$pkg"
|
||||
}
|
||||
|
||||
install_nerd_font() {
|
||||
local font_dir="$HOME/.local/share/fonts"
|
||||
|
||||
if fc-list 2>/dev/null | grep -qi "MesloLGS Nerd Font"; then
|
||||
echo "OK: MesloLGS Nerd Font already installed"
|
||||
return
|
||||
fi
|
||||
|
||||
if ! command -v curl &>/dev/null || ! command -v unzip &>/dev/null; then
|
||||
echo "SKIP: MesloLGS Nerd Font (curl and/or unzip not available)"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Installing MesloLGS Nerd Font..."
|
||||
local tmp_zip
|
||||
tmp_zip="$(mktemp --suffix=.zip)"
|
||||
if curl -fsSL -o "$tmp_zip" \
|
||||
"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip"; then
|
||||
mkdir -p "$font_dir"
|
||||
unzip -oq "$tmp_zip" -d "$font_dir" "*.ttf"
|
||||
fc-cache -f "$font_dir" >/dev/null
|
||||
echo "ADDED: MesloLGS Nerd Font to $font_dir"
|
||||
else
|
||||
echo "WARNING: failed to download Nerd Font, skipping"
|
||||
fi
|
||||
rm -f "$tmp_zip"
|
||||
}
|
||||
|
||||
install_lazygit() {
|
||||
local bin_dir="$HOME/.local/bin"
|
||||
|
||||
if command -v lazygit &>/dev/null; then
|
||||
echo "OK: lazygit already installed"
|
||||
return
|
||||
fi
|
||||
|
||||
if ! command -v curl &>/dev/null || ! command -v tar &>/dev/null; then
|
||||
echo "SKIP: lazygit (curl and/or tar not available)"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "Installing lazygit..."
|
||||
local version
|
||||
version="$(curl -fsSL https://api.github.com/repos/jesseduffield/lazygit/releases/latest \
|
||||
| grep -Po '"tag_name": "v\K[^"]*')"
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "WARNING: could not determine latest lazygit version, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
local tmp_tar
|
||||
tmp_tar="$(mktemp --suffix=.tar.gz)"
|
||||
if curl -fsSL -o "$tmp_tar" \
|
||||
"https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${version}_Linux_x86_64.tar.gz"; then
|
||||
mkdir -p "$bin_dir"
|
||||
tar -xzf "$tmp_tar" -C "$(dirname "$tmp_tar")" lazygit
|
||||
install -m 755 "$(dirname "$tmp_tar")/lazygit" "$bin_dir/lazygit"
|
||||
rm -f "$(dirname "$tmp_tar")/lazygit"
|
||||
echo "ADDED: lazygit $version to $bin_dir"
|
||||
else
|
||||
echo "WARNING: failed to download lazygit, skipping"
|
||||
fi
|
||||
rm -f "$tmp_tar"
|
||||
}
|
||||
|
||||
ensure_sourced() {
|
||||
local file="$1"
|
||||
local bashrc="$HOME/.bashrc"
|
||||
@@ -44,10 +110,12 @@ fi
|
||||
# bash — stow dotfiles, then ensure ~/.bashrc sources them
|
||||
stow_pkg bash
|
||||
ensure_sourced "$HOME/.bashrc.omb"
|
||||
install_lazygit
|
||||
|
||||
# kitty
|
||||
if command -v kitty &>/dev/null; then
|
||||
stow_pkg kitty
|
||||
install_nerd_font
|
||||
else
|
||||
echo "SKIP: kitty (not installed)"
|
||||
fi
|
||||
@@ -59,4 +127,11 @@ else
|
||||
echo "SKIP: fastfetch (not installed)"
|
||||
fi
|
||||
|
||||
# mc
|
||||
if command -v mc &>/dev/null; then
|
||||
stow_pkg mc
|
||||
else
|
||||
echo "SKIP: mc (not installed)"
|
||||
fi
|
||||
|
||||
echo "Done!"
|
||||
|
||||
Reference in New Issue
Block a user