mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 23:44:17 +08:00
Add bashrc and bash-completion
This commit is contained in:
parent
7b3cddad93
commit
42656cc5a6
@ -25,6 +25,7 @@ acid = {}
|
||||
base = {}
|
||||
base-initfs = {}
|
||||
bash = {}
|
||||
bash-completion = {}
|
||||
bootloader = {}
|
||||
bottom = {}
|
||||
ca-certificates = {}
|
||||
|
||||
@ -25,6 +25,7 @@ acid = {}
|
||||
base = {}
|
||||
base-initfs = {}
|
||||
bash = {}
|
||||
bash-completion = {}
|
||||
bootloader = {}
|
||||
bottom = {}
|
||||
ca-certificates = {}
|
||||
|
||||
@ -25,6 +25,7 @@ acid = {}
|
||||
base = {}
|
||||
base-initfs = {}
|
||||
bash = {}
|
||||
bash-completion = {}
|
||||
bootloader = {}
|
||||
bottom = {}
|
||||
ca-certificates = {}
|
||||
|
||||
@ -30,6 +30,7 @@ automake = {}
|
||||
base = {}
|
||||
base-initfs = {}
|
||||
bash = {}
|
||||
bash-completion = {}
|
||||
binutils = {}
|
||||
bootloader = {}
|
||||
bottom = {}
|
||||
|
||||
39
recipes/shells/bash/etc/bash.bashrc
Normal file
39
recipes/shells/bash/etc/bash.bashrc
Normal file
@ -0,0 +1,39 @@
|
||||
# System-wide .bashrc file for interactive bash(1) shells.
|
||||
|
||||
# To enable the settings / commands in this file for login shells as well,
|
||||
# this file has to be sourced in /etc/profile.
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# TODO: redox_chroot
|
||||
if [ -z "${redox_chroot:-}" ] && [ -r /etc/redox_chroot ]; then
|
||||
redox_chroot=$(cat /etc/redox_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, overwrite the one in /etc/profile)
|
||||
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
|
||||
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
|
||||
PS1='${redox_chroot:+($redox_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
|
||||
# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
#case "$TERM" in
|
||||
#xterm*|rxvt*)
|
||||
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
|
||||
# ;;
|
||||
#*)
|
||||
# ;;
|
||||
#esac
|
||||
|
||||
# enable bash completion in interactive shells
|
||||
#if ! shopt -oq posix; then
|
||||
# if [ -f /etc/bash_completion ]; then
|
||||
# . /etc/bash_completion
|
||||
# fi
|
||||
#fi
|
||||
27
recipes/shells/bash/etc/profile
Normal file
27
recipes/shells/bash/etc/profile
Normal file
@ -0,0 +1,27 @@
|
||||
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
|
||||
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
|
||||
|
||||
if [ "${PS1-}" ]; then
|
||||
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
|
||||
# The file bash.bashrc already sets the default PS1.
|
||||
# PS1='\h:\w\$ '
|
||||
if [ -f /etc/bash.bashrc ]; then
|
||||
. /etc/bash.bashrc
|
||||
fi
|
||||
else
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
PS1='# '
|
||||
else
|
||||
PS1='$ '
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d /etc/profile.d ]; then
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r $i ]; then
|
||||
. $i
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
fi
|
||||
99
recipes/shells/bash/etc/skel/.bashrc
Normal file
99
recipes/shells/bash/etc/skel/.bashrc
Normal file
@ -0,0 +1,99 @@
|
||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${redox_chroot:+($redox_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='${redox_chroot:+($redox_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
|
||||
# TODO
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
# alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
25
recipes/shells/bash/etc/skel/.profile
Normal file
25
recipes/shells/bash/etc/skel/.profile
Normal file
@ -0,0 +1,25 @@
|
||||
# ~/.profile: executed by the command interpreter for login shells.
|
||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
||||
# exists.
|
||||
|
||||
# the default umask is set in /etc/profile; for setting the umask
|
||||
# for ssh logins, install and configure the libpam-umask package.
|
||||
#umask 022
|
||||
|
||||
# if running bash
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
fi
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/.local/bin" ] ; then
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
@ -12,7 +12,7 @@ dependencies = [
|
||||
"readline",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
# compiled statically
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
ac_cv_func_wcwidth=no # TODO: add more wc functions and remove this
|
||||
bash_cv_func_sigsetjmp=no
|
||||
@ -23,4 +23,5 @@ COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
COOKBOOK_MAKE_JOBS=1 # workaround for parallel make bugs
|
||||
cookbook_configure
|
||||
ln -s "bash" "${COOKBOOK_STAGE}/usr/bin/sh"
|
||||
cp -r "${COOKBOOK_RECIPE}/etc" "${COOKBOOK_STAGE}/etc"
|
||||
"""
|
||||
|
||||
14
recipes/terminal/bash-completion/recipe.toml
Normal file
14
recipes/terminal/bash-completion/recipe.toml
Normal file
@ -0,0 +1,14 @@
|
||||
[source]
|
||||
tar = "https://src.fedoraproject.org/repo/pkgs/bash-completion/bash-completion-1.3.tar.bz2/a1262659b4bbf44dc9e59d034de505ec/bash-completion-1.3.tar.bz2"
|
||||
blake3 = "02014d743f403407f40fc05c2405c4bdce85c33a571d6b4b9a269369710c803f"
|
||||
|
||||
[build]
|
||||
template = "configure"
|
||||
configureflags = [
|
||||
"--prefix=/",
|
||||
]
|
||||
|
||||
[package]
|
||||
dependencies = [
|
||||
"sed",
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user