dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README

commit cef2e8e2a185e8a6652ee47efc021f16cc8a83c0
parent 33e4594367eac201681601fe0737ac2715c8c126
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Tue, 13 Sep 2022 15:10:56 -0500

Formatted shell files

Diffstat:
Mlinux/.bashrc | 50+++++++++++++++++++++++++-------------------------
Mlinux/.local/bin/before-exit | 6+++---
2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/linux/.bashrc b/linux/.bashrc @@ -1,19 +1,22 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return -shopt -s checkwinsize histappend histreedit +[[ $DISPLAY ]] && shopt -s checkwinsize +# Bash completions +if ! shopt -oq posix; then + [ -f /etc/bash_completion ] && source /etc/bash_completion + [ -f /usr/local/etc/bash_completion ] && source /usr/local/etc/bash_completion +fi + +shopt -s histappend histreedit +mkdir -p "$XDG_STATE_HOME"/bash +HISTFILE="$XDG_STATE_HOME"/bash/history HISTCONTROL=ignoreboth HISTSIZE=100000 HISTFILESIZE=200000 HISTTIMEFORMAT="%D %T " -# Bash completions -if ! shopt -oq posix; then - [ -f /etc/bash_completion ] && source /etc/bash_completion - [ -f /usr/local/etc/bash_completion ] && source /usr/local/etc/bash_completion -fi - LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 @@ -26,9 +29,6 @@ LESS_TERMCAP_se=$'\E[0m' # reset reverse video LESS_TERMCAP_us=$'\E[1;32m' # begin underline LESS_TERMCAP_ue=$'\E[0m' # reset underline -mkdir -p "$XDG_STATE_HOME"/bash -HISTFILE="$XDG_STATE_HOME"/bash/history - source $XDG_CONFIG_HOME/shell/aliases.sh GPG_TTY=$(tty) @@ -38,29 +38,29 @@ GPG_TTY=$(tty) #export GIT_PS1_SHOWDIRTYSTATE=1 PS1='[\u@\h \W] $(__git_ps1) \$ ' -cd () { echo "Use pushd!"; } +cd() { echo "Use pushd!"; } countdown() { - start="$(( $(date '+%s') + $1))" - while [ $start -ge $(date +%s) ]; do - time="$(( $start - $(date +%s) ))" - printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" - sleep 0.1 - done + start="$(($(date '+%s') + $1))" + while [ $start -ge $(date +%s) ]; do + time="$(($start - $(date +%s)))" + printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" + sleep 0.1 + done } stopwatch() { - start=$(date +%s) - while true; do - time="$(( $(date +%s) - $start))" - printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" - sleep 0.1 - done + start=$(date +%s) + while true; do + time="$(($(date +%s) - $start))" + printf '%s\r' "$(date -u -d "@$time" +%H:%M:%S)" + sleep 0.1 + done } -echo '$HOME' `ls $HOME -A | wc -l` +echo '$HOME' $(ls $HOME -A | wc -l) ls $HOME echo -echo '$XDG_CONFIG_HOME' `ls $XDG_CONFIG_HOME -A | wc -l` +echo '$XDG_CONFIG_HOME' $(ls $XDG_CONFIG_HOME -A | wc -l) ls $XDG_CONFIG_HOME echo diff --git a/linux/.local/bin/before-exit b/linux/.local/bin/before-exit @@ -3,9 +3,9 @@ # Check git repositories git -C ~/.dotfiles status -s git -C ~/.vim status -s -git -C ~/dox/dev/imca/flask_imca/ status -s -git -C ~/dox/dev/imca/webpack-imca/ status -s -git -C ~/dox/dev/thesis status -s +[ -d ~/dox/dev/imca/flask_imca ] && git -C ~/dox/dev/imca/flask_imca/ status -s +[ -d ~/dox/dev/imca/webpack_imca ] && git -C ~/dox/dev/imca/webpack-imca/ status -s +[ -d ~/dox/dev/thesis ] && git -C ~/dox/dev/thesis status -s # Check bib rsync -rcnv --delete $XDG_DATA_HOME/bib/ pcardenasb.com:$XDG_DATA_HOME/bib/