{bash,zsh}rc: add shebangs for shfmt

This commit is contained in:
Aminda Suomalainen 2023-05-20 12:12:51 +03:00
parent f77e15eb68
commit c4260af567
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 118 additions and 123 deletions

34
rc/bashrc Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env bash
UNAME=$(uname) UNAME=$(uname)
# TOC # TOC
# Defaults etc... M0TZLS # Defaults etc... M0TZLS
@ -7,8 +8,7 @@ UNAME=$(uname)
# enable terminal bell # enable terminal bell
if [ -f /usr/bin/xset ]; if [ -f /usr/bin/xset ]; then
then
(xset b on &) (xset b on &)
fi fi
@ -81,8 +81,7 @@ case "$TERM" in
xterm* | *rxvt*) xterm* | *rxvt*)
PS1="\[\e]0;\u@\h: \w\a\]$PS1" PS1="\[\e]0;\u@\h: \w\a\]$PS1"
;; ;;
*) *) ;;
;;
esac esac
# enable color support of ls and also add handy aliases # enable color support of ls and also add handy aliases
@ -102,7 +101,7 @@ if [[ $UNAME != Darwin ]]; then
alias ll='ls -alFh --color=always' && alias la='ls -A --color=always' && alias l='ls -CF --color=always' alias ll='ls -alFh --color=always' && alias la='ls -A --color=always' && alias l='ls -CF --color=always'
fi fi
if [[ $UNAME = Darwin ]]; then if [[ $UNAME == Darwin ]]; then
alias ls="ls -Gp" alias ls="ls -Gp"
alias ll="ls -alFHGp" alias ll="ls -alFHGp"
alias l="ls -CFGp" alias l="ls -CFGp"
@ -141,7 +140,7 @@ if [[ $UNAME != Darwin ]]; then
# (last -10 -w -x&) # (last -10 -w -x&)
fi fi
if [[ $UNAME = Darwin ]]; then if [[ $UNAME == Darwin ]]; then
(who -H -u | head -n10 &) (who -H -u | head -n10 &)
(echo "") (echo "")
(last -10 &) (last -10 &)
@ -151,7 +150,6 @@ fi
# fix dircolors for Selenized https://github.com/jan-warchol/selenized/blob/master/other-apps/dircolors/README.md # fix dircolors for Selenized https://github.com/jan-warchol/selenized/blob/master/other-apps/dircolors/README.md
export LS_COLORS="$LS_COLORS:ow=1;7;34:st=30;44:su=30;41" export LS_COLORS="$LS_COLORS:ow=1;7;34:st=30;44:su=30;41"
##### Environment 7RS56S ##### ##### Environment 7RS56S #####
# Environment should be placed to .environment or .bash_environment. # Environment should be placed to .environment or .bash_environment.
@ -213,7 +211,7 @@ UNAME=$(uname)
CPUARCH=$(uname -p) CPUARCH=$(uname -p)
# If we are on Linux, enable apt progress bar and colours # If we are on Linux, enable apt progress bar and colours
if [[ $USER = "root" ]]; then if [[ $USER == "root" ]]; then
mkdir -p /etc/apt/apt.conf.d/ mkdir -p /etc/apt/apt.conf.d/
echo 'Dpkg::Progress-Fancy "1";' >/etc/apt/apt.conf.d/99progressbar echo 'Dpkg::Progress-Fancy "1";' >/etc/apt/apt.conf.d/99progressbar
echo 'APT::Color "1";' >/etc/apt/apt.conf.d/99color echo 'APT::Color "1";' >/etc/apt/apt.conf.d/99color
@ -528,8 +526,7 @@ alias mpvm="mpv --no-video"
alias mpvms="mpv --no-video --shuffle" alias mpvms="mpv --no-video --shuffle"
# Compatibility with my i3 alsactl mess # Compatibility with my i3 alsactl mess
if [ -f ~/.config/asound.state ] if [ -f ~/.config/asound.state ]; then
then
alias alsactl="\alsactl -f ~/.config/asound.state" alias alsactl="\alsactl -f ~/.config/asound.state"
fi fi
@ -568,9 +565,7 @@ function geoip() {
## for unit193 ;) ## for unit193 ;)
## use command "ex" to extract any archive files. ## use command "ex" to extract any archive files.
## "ex package.zip" for example ## "ex package.zip" for example
function ex () function ex() {
{
if [ -f "$1" ]; then if [ -f "$1" ]; then
case "$1" in case "$1" in
*.tar) tar xvf $1 ;; *.tar) tar xvf $1 ;;
@ -587,9 +582,11 @@ case "$1" in
DIR=${1%%_*.deb} DIR=${1%%_*.deb}
ar xv $1 ar xv $1
mkdir ${DIR} mkdir ${DIR}
tar -C ${DIR} -xzvf data.tar.gz ;; tar -C ${DIR} -xzvf data.tar.gz
;;
*.rpm) rpm2cpio $1 | cpio -vid ;; *.rpm) rpm2cpio $1 | cpio -vid ;;
*) echo ""${1}" cannot be extracted via extract()" *)
echo ""${1}" cannot be extracted via extract()"
;; ;;
esac esac
else else
@ -673,13 +670,11 @@ cd
# This function fixes nodejs on Debian based systems. # This function fixes nodejs on Debian based systems.
# (Everything expects nodejs to be called as node, but it's not with Debian.) # (Everything expects nodejs to be called as node, but it's not with Debian.)
fix-node() { fix-node() {
if [[ $USER = "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]] if [[ $USER == "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]]; then
then
ln -s /usr/bin/nodejs /usr/local/bin/node ln -s /usr/bin/nodejs /usr/local/bin/node
fi fi
mkdir -p $HOME/.local/bin mkdir -p $HOME/.local/bin
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]] if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]]; then
then
ln -s /usr/bin/nodejs $HOME/.local/bin/node ln -s /usr/bin/nodejs $HOME/.local/bin/node
fi fi
} }
@ -811,7 +806,6 @@ ssh-verify-file () {
ssh-keygen -Y verify -f $sshAllowedSigners -I $1 -n file -s $2.sig <$2 ssh-keygen -Y verify -f $sshAllowedSigners -I $1 -n file -s $2.sig <$2
} }
# Source files for miscannellious modifications. # Source files for miscannellious modifications.
# acme.sh # acme.sh

1
rc/zshrc Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env zsh
# TOC # TOC
# Defaults etc... M0TZLS # Defaults etc... M0TZLS
# Environment 7RS56S # Environment 7RS56S