Files
mates-infra/macos-setup/configure-fish.sh
T
mates 444191d16d feat: initial infra repo
- docker-services: 14 generic compose templates (portainer, npm, vaultwarden, gitea, jotty, nextcloud-aio, rustdesk, audiobookshelf, calibre-web, plex, erugo, jswiki, speedtest, watchtower)
- install-scripts: bash scripts for Ubuntu server bootstrap, docker, portainer, npm, backup, restore
- ansible: 4 playbooks (bootstrap, deploy-services, update-services, security-hardening) + roles skeleton
- hermes-install: Hermes CLI setup on macOS
- macos-setup: Brewfile + osx-defaults + fish-config
- home-nas-tools: metadata index for NAS projects (no binaries)
- docs: architecture, security, contributing
- README, LICENSE (MIT), .gitignore
2026-08-01 16:25:58 +02:00

66 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
#
# Nastaví Fish shell s užitečnými aliasy
# - uloží konfiguraci do ~/.config/fish/config.fish
# - pokud Fish neexistuje, nainstaluje ho
# - idempotentní (přidá/aktualizuje aliasy, nesmaže existující)
#
# Vyžaduje fish 3.0+ a Homebrew
#
set -euo pipefail
FISH_CONFIG="$HOME/.config/fish/config.fish"
# Pokud fish není nainstalovaný, nainstaluj
if ! command -v fish &>/dev/null; then
echo "▶ Instaluji fish..."
if command -v brew &>/dev/null; then
brew install fish
else
echo "✗ Homebrew není nainstalován. Nainstaluj ho ručně: https://brew.sh/" >&2
exit 1
fi
fi
# Vytvoř adresář
mkdir -p "$(dirname "$FISH_CONFIG")"
# Definice aliasů
declare -A ALIASES=(
["update"]="brew update && brew upgrade && brew cleanup"
["ll"]="eza -la --git --time-style=long-iso"
["ls"]="eza"
["cat"]="bat --paging=never"
["find"]="fd"
["grep"]="rg"
["top"]="btop"
["ps"]="procs"
["g"]="git"
["d"]="docker"
["dc"]="docker compose"
["k"]="kubectl"
["llog"]="docker compose logs -f --tail=100"
["dip"]="docker compose logs -f --tail=100 \\\\"
["myip"]="curl -s https://api.ipify.org && echo"
["weather"]="curl -s 'wttr.in?format=3'"
)
# Funkce pro generování
{
echo "# ~/.config/fish/config.fish"
echo "# Generováno configure-fish.sh $(date +%Y-%m-%d)"
echo ""
echo "set -g fish_greeting \"\""
echo "set -gx PATH /opt/homebrew/bin \$PATH"
echo "set -gx EDITOR vim"
echo ""
for alias in "${!ALIASES[@]}"; do
echo "alias $alias='${ALIASES[$alias]}'"
done
} > "$FISH_CONFIG"
echo "✓ Konfigurace Fish v $FISH_CONFIG"
echo
echo "Použití: spusť 'fish' v terminálu"
echo "Ověření: alias ll → ${ALIASES[ll]}"