#!/bin/bash
# ~/.bashrc — SamiOS root shell configuration
# Loaded by Bash for interactive shells

# ============================================================
# History
# ============================================================
HISTSIZE=1000
HISTFILESIZE=2000
shopt -s histappend

# ============================================================
# Shell options
# ============================================================
shopt -s checkwinsize
shopt -s cdable_vars

# ============================================================
# Aliases
# ============================================================
alias ls='ls --color=auto'
alias ll='ls -lah'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
alias df='df -h'
alias free='free -h'

# SamiOS-specific aliases
alias samios-status='samios status'
alias samios-help='samios help'

# ============================================================
# Prompt — SamiOS branded
# ============================================================
# Blue pyramid color matches brand primary (#1424CE)
PS1='\[\e[1;34m\]▲ SamiOS\[\e[0m\] \[\e[32m\]\u@\h\[\e[0m\] \w \$ '

# ============================================================
# Welcome message — printed once per interactive login shell
# ============================================================
if shopt -q login_shell; then
    # Resolve version from the canonical source (single file under
    # /etc/samios-version). The fallback "0.0.0-unknown" is documented
    # in samios CLI's _lookup_version as the placeholder for missing
    # canonical state.
    SAMIOS_VER=$(cat /etc/samios-version 2>/dev/null || echo "0.0.0-unknown")
    echo ""
    echo -e "  \033[1;34m    ▲\033[0m  \033[1;34mSamiOS\033[0m \033[0;37m${SAMIOS_VER}\033[0m"
    echo -e "  \033[0;37m    |\\\\   Arch-based Linux by Sami Ahmed\033[0m"
    echo -e "  \033[0;37m    | \\\\  https://sami-ahmed.net\033[0m"
    echo ""
    echo -e "  \033[0;37mCommands:\033[0m  \033[1;msamios help\033[0m  ·  \033[1;msamios status\033[0m  ·  \033[1;msamios fonts\033[0m"
    echo ""
fi
