bash: Aggiorna "Environment variables"
File di configurazione di Bash: aggiorna le parti che impostano alcune variabili d'ambiente ("Environment variables"), e applica alcune altre piccole modifiche.
This commit is contained in:
parent
16432f7ca5
commit
54ae465630
3 changed files with 46 additions and 23 deletions
|
@ -1,4 +1,4 @@
|
|||
# shellcheck shell=sh
|
||||
# shellcheck shell=bash
|
||||
# ~/.bash_profile: executed by the command interpreter for login shells.
|
||||
#
|
||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
||||
|
@ -12,13 +12,15 @@
|
|||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
#shellcheck disable=SC1091
|
||||
. "$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"
|
||||
# Environment variables
|
||||
# set PATH so it includes '~/AppImage' directory, if it exists
|
||||
if [ -d "$HOME/AppImage" ] ; then
|
||||
PATH="$HOME/AppImage:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin, if it exists
|
||||
|
@ -26,12 +28,11 @@ if [ -d "$HOME/.local/bin" ] ; then
|
|||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes '~/AppImage' directory, if it exists
|
||||
if [ -d "$HOME/AppImage" ] ; then
|
||||
PATH="$HOME/AppImage:$PATH"
|
||||
# set PATH so it includes user's private bin, if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Environment variables
|
||||
# XDG Base Directory specification
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
|
|
25
bash/.bashrc
25
bash/.bashrc
|
@ -18,12 +18,15 @@ shopt -s histappend
|
|||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
HISTFILESIZE=10000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# Automatically prepend `cd` when entering just a path in the shell
|
||||
#shopt -s autocd
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
@ -77,7 +80,7 @@ esac
|
|||
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 dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
|
@ -99,6 +102,7 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo
|
|||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f "$HOME/.bash_aliases" ]; then
|
||||
#shellcheck disable=SC1091
|
||||
. "$HOME/.bash_aliases"
|
||||
fi
|
||||
|
||||
|
@ -112,3 +116,20 @@ if ! shopt -oq posix; then
|
|||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
# Environment variables
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
export EDITOR=xed
|
||||
elif [ -n "$WAYLAND_DISPLAY" ]; then
|
||||
export EDITOR=xed
|
||||
else
|
||||
export EDITOR=nano
|
||||
fi
|
||||
|
||||
if [ -n "$DISPLAY" ]; then
|
||||
export BROWSER=firefox
|
||||
elif [ -n "$WAYLAND_DISPLAY" ]; then
|
||||
export BROWSER=firefox
|
||||
else
|
||||
export BROWSER=
|
||||
fi
|
||||
|
|
|
@ -13,26 +13,27 @@
|
|||
if [ -n "$BASH_VERSION" ]; then
|
||||
# include .bashrc if it exists
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
. "$HOME/.bashrc"
|
||||
#shellcheck disable=SC1091
|
||||
. "$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
|
||||
|
||||
# Environment variables
|
||||
# set PATH so it includes '~/AppImage' directory, if it exists
|
||||
if [ -d "$HOME/AppImage" ] ; then
|
||||
PATH="$HOME/AppImage:$PATH"
|
||||
fi
|
||||
|
||||
# Environment variables
|
||||
# set PATH so it includes user's private bin, if it exists
|
||||
if [ -d "$HOME/.local/bin" ] ; then
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
# set PATH so it includes user's private bin, if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
# XDG Base Directory specification
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
|
|
Loading…
Reference in a new issue