mirror of
https://github.com/getcompanion-ai/computer-guest.git
synced 2026-04-15 08:03:40 +00:00
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
case $- in
|
|
*i*) ;;
|
|
*) return ;;
|
|
esac
|
|
|
|
# Ensure user-local binaries are on PATH.
|
|
[[ ":$PATH:" == *":$HOME/.local/bin:"* ]] || export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
computer_prompt_base_name() {
|
|
local name=""
|
|
if [ -r /etc/microagent/machine-name ]; then
|
|
IFS= read -r name </etc/microagent/machine-name || true
|
|
elif [ -r /etc/hostname ]; then
|
|
IFS= read -r name </etc/hostname || true
|
|
elif [ -n "${COMPUTER_NAME:-}" ]; then
|
|
name="${COMPUTER_NAME}"
|
|
elif [ -n "${COMPUTER_HANDLE:-}" ]; then
|
|
name="${COMPUTER_HANDLE}"
|
|
fi
|
|
if [ -z "$name" ]; then
|
|
name="microagentcomputer"
|
|
fi
|
|
printf '%s' "$name"
|
|
}
|
|
|
|
computer_prompt_name() {
|
|
printf '%s' "$(computer_prompt_base_name)"
|
|
}
|
|
|
|
export EDITOR="${EDITOR:-nvim}"
|
|
export VISUAL="${VISUAL:-nvim}"
|
|
alias vim='nvim'
|
|
alias ls='eza --group-directories-first --icons=auto'
|
|
alias la='eza -a --group-directories-first --icons=auto'
|
|
alias ll='eza -lah --git --group-directories-first --icons=auto'
|
|
alias lt='eza --tree --level=2 --group-directories-first --icons=auto'
|
|
|
|
export PS1="\[\033[01;32m\]\$(computer_prompt_name)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
|