From 73ebbde86316a63256f82e80163468315f3be4ec Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 29 Jun 2026 13:03:52 -0300 Subject: [PATCH] distro-files: add .bashrc, /etc/bashrc, move ps1 handling to it and fix xterm /etc/shells --- distro-files/etc/bashrc | 6 ++++++ distro-files/etc/profile | 18 ++++++++++++------ distro-files/etc/shells | 1 + distro-files/etc/skel/.bashrc | 3 +++ distro-files/home/astral/.bashrc | 3 +++ distro-files/root/.bashrc | 3 +++ recipes/distro-files | 2 +- 7 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 distro-files/etc/bashrc create mode 100644 distro-files/etc/skel/.bashrc create mode 100644 distro-files/home/astral/.bashrc create mode 100644 distro-files/root/.bashrc diff --git a/distro-files/etc/bashrc b/distro-files/etc/bashrc new file mode 100644 index 00000000..6dfb37bd --- /dev/null +++ b/distro-files/etc/bashrc @@ -0,0 +1,6 @@ +NORMAL="\[\e[0m\]" +RED="\[\e[1;31m\]" +GREEN="\[\e[1;32m\]" +BLUE="\[\e[1;36m\]" +WHITE="\[\e[1;37m\]" +PS1="$GREEN\u$NORMAL@$BLUE\h$NORMAL:$WHITE\w$NORMAL>" diff --git a/distro-files/etc/profile b/distro-files/etc/profile index 561df4c7..b0d45cb6 100644 --- a/distro-files/etc/profile +++ b/distro-files/etc/profile @@ -1,13 +1,19 @@ -NORMAL="\[\e[0m\]" -RED="\[\e[1;31m\]" -GREEN="\[\e[1;32m\]" -BLUE="\[\e[1;36m\]" -WHITE="\[\e[1;37m\]" -PS1="$GREEN\u$NORMAL@$BLUE\h$NORMAL:$WHITE\w$NORMAL>" +if [ -n "$BASH_VERSION" ] && [ -r /etc/bashrc ]; then + . /etc/bashrc +fi alias ls="ls --color=auto" alias grep="grep --color=auto" +if [ "$(id -u)" = 0 ]; then + export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +else + export PATH="/usr/local/bin:/usr/bin:/bin" +fi + +export XDG_DATA_DIRS="/usr/local/share:/usr/share" +export XDG_CONFIG_DIRS="/etc/xdg" + if [ $(tty) == "/dev/console" ] then alias startwm="exec /usr/libexec/astral/startwm" diff --git a/distro-files/etc/shells b/distro-files/etc/shells index c7f10661..1ae29465 100644 --- a/distro-files/etc/shells +++ b/distro-files/etc/shells @@ -1,2 +1,3 @@ +# /etc/shells /usr/bin/bash /bin/sh diff --git a/distro-files/etc/skel/.bashrc b/distro-files/etc/skel/.bashrc new file mode 100644 index 00000000..9e860bf4 --- /dev/null +++ b/distro-files/etc/skel/.bashrc @@ -0,0 +1,3 @@ +if [ -r /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/distro-files/home/astral/.bashrc b/distro-files/home/astral/.bashrc new file mode 100644 index 00000000..9e860bf4 --- /dev/null +++ b/distro-files/home/astral/.bashrc @@ -0,0 +1,3 @@ +if [ -r /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/distro-files/root/.bashrc b/distro-files/root/.bashrc new file mode 100644 index 00000000..9e860bf4 --- /dev/null +++ b/distro-files/root/.bashrc @@ -0,0 +1,3 @@ +if [ -r /etc/bashrc ]; then + . /etc/bashrc +fi diff --git a/recipes/distro-files b/recipes/distro-files index 910299d3..b5d45bc8 100644 --- a/recipes/distro-files +++ b/recipes/distro-files @@ -1,5 +1,5 @@ name=distro-files -revision=3 +revision=6 from_source=distro-files package() {