From 54ae46563030b254e30bac1f52c83600e8f2f917 Mon Sep 17 00:00:00 2001 From: Luca Pellegrini Date: Wed, 5 Apr 2023 13:15:47 +0200 Subject: [PATCH] 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. --- bash/.bash_profile | 19 ++++++++++--------- bash/.bashrc | 25 +++++++++++++++++++++++-- bash/.profile | 25 +++++++++++++------------ 3 files changed, 46 insertions(+), 23 deletions(-) diff --git a/bash/.bash_profile b/bash/.bash_profile index acc9414..522de74 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -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" diff --git a/bash/.bashrc b/bash/.bashrc index 5632700..a204673 100644 --- a/bash/.bashrc +++ b/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 diff --git a/bash/.profile b/bash/.profile index 8eeef42..2795029 100644 --- a/bash/.profile +++ b/bash/.profile @@ -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"