mirror of
https://github.com/opensiriusfox/bashrc.d.git
synced 2025-06-16 20:31:15 -07:00
merge to master.
This commit is contained in:
parent
6b0359046d
commit
7fb554740a
7 changed files with 79 additions and 49 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
.directory
|
.directory
|
||||||
|
1-compiled
|
||||||
|
|
42
0-builder
Normal file
42
0-builder
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/bin/bash
|
||||||
|
export IFS=$'\n'
|
||||||
|
|
||||||
|
BASHRC_D="$HOME/.bashrc.d"
|
||||||
|
COMPILED_SRC="$BASHRC_D/1-compiled"
|
||||||
|
echo "Rebuilding $COMPILED_SRC"
|
||||||
|
|
||||||
|
echo """#!/bin/bash
|
||||||
|
# COMPILED AUTOMAGICALLY AT """$(date -I)"""
|
||||||
|
|
||||||
|
""" > $COMPILED_SRC
|
||||||
|
|
||||||
|
SELF_SRC=$(readlink -f $0)
|
||||||
|
for F in $(find $BASHRC_D -maxdepth 1 -iname "*.sh"); do
|
||||||
|
echo " Building in $F"
|
||||||
|
echo "##################" >> $COMPILED_SRC
|
||||||
|
echo "# $(basename $F)" >> $COMPILED_SRC
|
||||||
|
echo "##################" >> $COMPILED_SRC
|
||||||
|
cat $F >> $COMPILED_SRC
|
||||||
|
echo "" >> $COMPILED_SRC
|
||||||
|
done
|
||||||
|
|
||||||
|
HOST_SPECIFIC_SRC="$BASHRC_D/hostname/$(hostname).sh"
|
||||||
|
if [[ -e $HOST_SPECIFIC_SRC ]]; then
|
||||||
|
echo "Adding host specific file $HOST_SPECIFIC_SRC"
|
||||||
|
echo "##################" >> $COMPILED_SRC
|
||||||
|
echo "# $(basename $HOST_SPECIFIC_SRC)" >> $COMPILED_SRC
|
||||||
|
echo "##################" >> $COMPILED_SRC
|
||||||
|
cat $HOST_SPECIFIC_SRC >> $COMPILED_SRC
|
||||||
|
echo "" >> $COMPILED_SRC
|
||||||
|
else
|
||||||
|
echo "No host specific file found at $HOST_SPECIFIC_SRC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "##################" >> $COMPILED_SRC
|
||||||
|
echo "# Reloader Script" >> $COMPILED_SRC
|
||||||
|
echo """##################
|
||||||
|
function __rebuild_bashrcd() {
|
||||||
|
bash """$SELF_SRC"""
|
||||||
|
}
|
||||||
|
""" >> $COMPILED_SRC
|
||||||
|
|
|
@ -27,6 +27,9 @@ alias fdiff="sdiff -t --tabsize=4 -w \$(tput cols) -b"
|
||||||
alias rsync-prog="rsync -Pav"
|
alias rsync-prog="rsync -Pav"
|
||||||
alias parallel="parallel --no-notice"
|
alias parallel="parallel --no-notice"
|
||||||
|
|
||||||
|
export IDF_TOOLS_PATH=/opt/esp
|
||||||
|
alias get_idf=". ${IDF_TOOLS_PATH}/esp-idf/export.sh"
|
||||||
|
|
||||||
if [[ -e /opt/eagle/eagle/eagle ]]; then
|
if [[ -e /opt/eagle/eagle/eagle ]]; then
|
||||||
alias eagle=$(readlink -f /opt/eagle/eagle/eagle)
|
alias eagle=$(readlink -f /opt/eagle/eagle/eagle)
|
||||||
fi
|
fi
|
||||||
|
|
4
hostname/kusanagi.sh
Normal file
4
hostname/kusanagi.sh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
export GTK_IM_MODULE=ibus
|
||||||
|
export XMODIFIERS=@im=ibus
|
||||||
|
export QT_IM_MODULE=ibus
|
5
misc.sh
5
misc.sh
|
@ -9,6 +9,7 @@ if [[ -e /usr/share/autojump/autojump.sh ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LESS=R # colorize less output if we use a pipe
|
export LESS=R # colorize less output if we use a pipe
|
||||||
HISTSIZE=2000
|
export HISTSIZE=10000
|
||||||
HISTFILESIZE=10000
|
export HISTFILESIZE=20000
|
||||||
|
|
||||||
|
export HISTIGNORE='pwd:exit:fg:bg:top:clear:history:ls:uptime:df'
|
|
@ -28,6 +28,13 @@ function pathStrip() {
|
||||||
#####################################################################
|
#####################################################################
|
||||||
# A function to load enviornment variables
|
# A function to load enviornment variables
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
function loadBinDir() {
|
||||||
|
DIR_EXPAND=$(readlink -f "$1")
|
||||||
|
if [ -d "$DIR_EXPAND"]; then
|
||||||
|
pathSTripAdd "$DIR_EXPAND/bin" "$2"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function loadDirectory() {
|
function loadDirectory() {
|
||||||
DIR_EXPAND=$(readlink -f "$1")
|
DIR_EXPAND=$(readlink -f "$1")
|
||||||
if [ -d "$DIR_EXPAND" ] ; then
|
if [ -d "$DIR_EXPAND" ] ; then
|
||||||
|
@ -49,18 +56,30 @@ function loadDirectory() {
|
||||||
export ACLOCAL_FLAGS="-I $DIR_EXPAND/share/aclocal $ACLOCAL_FLAGS"
|
export ACLOCAL_FLAGS="-I $DIR_EXPAND/share/aclocal $ACLOCAL_FLAGS"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
###########
|
###########
|
||||||
|
# Load information that is in any extra random installed directory.
|
||||||
|
__LOAD_DIRS=(
|
||||||
|
/opt/poke
|
||||||
|
/opt/fpga
|
||||||
|
/opt/makemkv
|
||||||
|
/opt/icestorm
|
||||||
|
/opt/gemini
|
||||||
|
$HOME/.gem/ruby/2.7.0
|
||||||
|
)
|
||||||
|
for DIR_EXPAND in ${__LOAD_DIRS[@]}; do
|
||||||
|
loadDirectory $DIR_EXPAND
|
||||||
|
done
|
||||||
|
unset DIR_EXPAND __LOAD_DIRS
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
# set PATH so it includes user's private bin if it exists
|
||||||
if [ -d "$HOME/bin" ] ; then
|
__LOAD_PATHS=("$HOME/.cargo/bin" "$HOME/bin" "$HOME/.bin" )
|
||||||
pathStripAdd "$HOME/bin" front
|
for DIR_EXPAND in ${__LOAD_PATHS[@]}; do
|
||||||
fi
|
pathStripAdd "$DIR_EXPAND" front
|
||||||
if [ -d "$HOME/.bin" ] ; then
|
done
|
||||||
pathStripAdd "$HOME/.bin" front
|
unset DIR_EXPAND __LOAD_PATHS
|
||||||
fi
|
|
||||||
|
|
||||||
# And load the local directory
|
# And load the local directory
|
||||||
if [ -d "$HOME/.local" ] ; then
|
if [ -d "$HOME/.local" ] ; then
|
||||||
|
@ -70,43 +89,3 @@ if [ -d "$HOME/.local" ] ; then
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load information that is in any extra random installed directory.
|
|
||||||
__LOAD_DIRS=(/opt/fpga /opt/makemkv /opt/icestorm)
|
|
||||||
for DIR_EXPAND in ${__LOAD_DIRS[*]}; do
|
|
||||||
loadDirectory $DIR_EXPAND
|
|
||||||
done
|
|
||||||
unset DIR_EXPAND __LOAD_DIRS
|
|
||||||
|
|
||||||
## This block was a legacy bit from when I spent so much time screwing around
|
|
||||||
# with Macports and had really janky enviornment varables. I don't need this
|
|
||||||
# anymore because the loader is now mature enough to not randomly throw garbage
|
|
||||||
# into the enviornment variables. This code is left simply for legacy purposes
|
|
||||||
# as an example of what you end up writing if you really have no idea what your
|
|
||||||
# doing (also known as learning!).
|
|
||||||
## CLEAN these variables
|
|
||||||
#__VAR_PTR_LST=(PKG_CONFIG_PATH LD_RUN_PATH LD_LIBRARY_PATH)
|
|
||||||
#for __VAR_PTR in ${__VAR_PTR_LST[*]}
|
|
||||||
#do
|
|
||||||
# # get the value in the pointer
|
|
||||||
# eval __VAR_VAL=\$$__VAR_PTR
|
|
||||||
# if [ ${#__VAR_VAL} -gt 0 ]; then
|
|
||||||
# # Strip ending : or leading : if exists.
|
|
||||||
# if [ ${__VAR_VAL: -1} == ":" ]; then
|
|
||||||
# __VAR_VAL=${__VAR_VAL:0:-1}
|
|
||||||
# fi
|
|
||||||
# if [ ${__VAR_VAL:0:1} == ":" ]; then
|
|
||||||
# __VAR_VAL=${__VAR_VAL:1}
|
|
||||||
# fi
|
|
||||||
# while [[ $__VAR_VAL == *"::"* ]]; do
|
|
||||||
# __VAR_VAL=${__VAR_VAL/::/:}
|
|
||||||
# done
|
|
||||||
# while [[ $__VAR_VAL == *"/:"* ]]; do
|
|
||||||
# __VAR_VAL=${__VAR_VAL/\/:/:}
|
|
||||||
# done
|
|
||||||
# # save the cleaned result
|
|
||||||
# eval $__VAR_PTR=$__VAR_VAL
|
|
||||||
# #echo $__VAR_PTR "=" $__VAR_VAL
|
|
||||||
# fi
|
|
||||||
#done
|
|
||||||
#unset __VAR_PTR_LST __VAR_PTR __VAR_VAL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue