From f13815efce733d23ba7dc1003d0decde09fccd4c Mon Sep 17 00:00:00 2001 From: mitsuo Date: Mon, 22 Nov 2021 04:42:22 -0500 Subject: General cleanup, make bashrc safer - Add "if-fi wrappers" before executing some commands in bashrc - Attempt in organizing things better in bashrc, profile and bash_aliases. (Like moving some env. var. exports to bashrc --- README.md | 17 +++++++++++++++++ bash_aliases | 16 ++-------------- bashrc | 61 ++++++++++++++++++++++++++++++++++-------------------------- profile | 4 ++++ readme.md | 17 ----------------- vimrc | 2 ++ 6 files changed, 60 insertions(+), 57 deletions(-) create mode 100644 README.md delete mode 100644 readme.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7fa38e --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +My configuration settings and config files for various programs. + + +# Files + +``` +20-libinput.conf enable touchpad functionality +bash_aliases +bashrc bash "run commands" +fun.vim some vim functions +inputrc vim input for bash +newdebian my debian/KDE Pasma 5 conf +qtcurvetestsettings.qtcurve +slinks symlinks script +vimrc vim "run commands" + +``` diff --git a/bash_aliases b/bash_aliases index e78483c..89ea6e0 100644 --- a/bash_aliases +++ b/bash_aliases @@ -16,17 +16,7 @@ alias la='ls -A' alias ll='ls -l -h' alias lla='ll -A' alias ls='ls --color=auto --group-directories-first --classify' -#alias less='less -Ri' # make less's searches case insensitive and - # colorized -# TODO move to an appropiate place: -LESS="-i --RAW-CONTROL-CHARS"; -export LESS - -LINDOAPI_HOME=/home/mitsuo/code/LINDO/lindoapi -export LINDOAPI_HOME -LINDOAPI_LICENSE_FILE="$LINDOAPI_HOME/license/lndapi130.lic" -export LINDOAPI_LICENSE_FILE alias gcc='gcc -g -std=c99 -lm' alias ed='ed -p "* "' alias diff='diff -s' @@ -60,8 +50,8 @@ alias mpv_nhk_720p='mpv "https://nhkwlive-ojp.akamaized.net/hls/live/2003459/nhk alias scan_dpto_europa='hp-scan --mode=color --device=hpaio:/net/OfficeJet_Pro_6970?ip=192.168.0.7' #alias java8='~/code/openjdk8/jdk8u265-b01/bin/java' #alias javac8='~/code/openjdk8/jdk8u265-b01/bin/javac' -alias inf265_jupyterlab='cd "/home/mitsuo/docs/courses/2021-1/INF265"; \ - jupyter lab' +#alias inf265_jupyterlab='cd /home/mitsuo/docs/courses/2021-1/INF265; \ +# jupyter lab' # Cosmetic @@ -71,5 +61,3 @@ alias :q='cowsay -d "this isn'\''t Vim"' # To scape single quotes in single # string and add the scaped quote # (\'). alias :w="cowsay -b \"this isn't Vim\"" -alias miola='cowsay -e ^^ "te extraΓ±o, mi galletita"' -alias miola2='cowsay -e ^^ "🌊Nandita πŸ’ƒ bonita 🌊"' diff --git a/bashrc b/bashrc index 58a2cd3..cafc93a 100644 --- a/bashrc +++ b/bashrc @@ -121,34 +121,43 @@ if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi -# Bash completition for pandoc -eval "$(pandoc --bash-completion)" +# My shit +# ======= -# Greeting or salute -# TODO: randomly select one of the following greeting commands -#cowsay -f flaming-sheep "oh no" # original -#cowsay $(fortune -e 30% debian-hints 20% linux 20% science \ -cowsay $(fortune 30% debian-hints 20% linux 20% science \ - 20% off/linux 10% off/black-humor) -#fortune ascii-art - -# Some environmental variables. +# Custom prompt: +# Blue timestamp and italic green pwd +PS1='\[\033[34m\]|\D{%H:%M:%S}| \[\033[3;32m\][\w]\[\033[00m\]\n\$ ' + +# Environmental variables: +# less(1) config (ignore case in searchs and display raw control characters) +export LESS="-i --RAW-CONTROL-CHARS"; +# Needed for tldr(1) export TLDR_CONFIG_DIR="$XDG_CONFIG_HOME" +# Needed for gpg(1)? export GPG=TTY=$(tty) -# Disable this shit that broke many things in my system ( RIP hplip :( ) -## >>> conda initialize >>> -## !! Contents within this block are managed by 'conda init' !! -#__conda_setup="$('/home/mitsuo/code/Anaconda/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" -#if [ $? -eq 0 ]; then -# eval "$__conda_setup" -#else -# if [ -f "/home/mitsuo/code/Anaconda/anaconda3/etc/profile.d/conda.sh" ]; then -# . "/home/mitsuo/code/Anaconda/anaconda3/etc/profile.d/conda.sh" -# else -# export PATH="/home/mitsuo/code/Anaconda/anaconda3/bin:$PATH" -# fi -#fi -#unset __conda_setup -## <<< conda initialize <<< +# Bash completition for pandoc +if [ -f /usr/bin/pandoc ]; then + eval "$(pandoc --bash-completion)" +fi + +# Greeting or salute +if [ -f /usr/games/cowsay ]; then + # TODO: randomly select one of the following greeting commands + #cowsay -f flaming-sheep "oh no" # original + #cowsay $(fortune -e 30% debian-hints 20% linux 20% science \ + cowsay $(fortune 30% debian-hints 20% linux 20% science \ + 20% off/linux 10% off/black-humor) + #fortune ascii-art +fi +# Homebrew (linuxbrew) + +if [ -f /usr/bin/brew ]; then + # for elf executables + export PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}" + # for manpages + export MANPATH="/home/linuxbrew/.linuxbrew/share/man:${MANPATH}" + # for info pages + export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH}" +fi diff --git a/profile b/profile index ca4a21f..eb10522 100644 --- a/profile +++ b/profile @@ -1,3 +1,7 @@ +# On Debian this file is loaded when the user first logs in login(1) +# If you want something that loads everytime a new terminal emulator is launched +# then put it inside .bashrc + if [ "$SHELL" = "/bin/bash" ]; then . ~/.bashrc fi diff --git a/readme.md b/readme.md deleted file mode 100644 index b7fa38e..0000000 --- a/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -My configuration settings and config files for various programs. - - -# Files - -``` -20-libinput.conf enable touchpad functionality -bash_aliases -bashrc bash "run commands" -fun.vim some vim functions -inputrc vim input for bash -newdebian my debian/KDE Pasma 5 conf -qtcurvetestsettings.qtcurve -slinks symlinks script -vimrc vim "run commands" - -``` diff --git a/vimrc b/vimrc index 08a8eee..83aab15 100644 --- a/vimrc +++ b/vimrc @@ -9,6 +9,8 @@ " β””β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”˜ こ γ‚Œ " XDG compliant REMOVED :D (what a pain) +" - For new installs just copy (or link) this file into ~/.vimrc and create +" the ~/.vim directory " TODO: - sort sections -- cgit v1.2.3