{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)
# TOC
# Defaults etc... M0TZLS
@ -7,8 +8,7 @@ UNAME=$(uname)
# enable terminal bell
if [ -f /usr/bin/xset ];
then
if [ -f /usr/bin/xset ]; then
(xset b on &)
fi
@ -81,8 +81,7 @@ case "$TERM" in
xterm* | *rxvt*)
PS1="\[\e]0;\u@\h: \w\a\]$PS1"
;;
*)
;;
*) ;;
esac
# 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'
fi
if [[ $UNAME = Darwin ]]; then
if [[ $UNAME == Darwin ]]; then
alias ls="ls -Gp"
alias ll="ls -alFHGp"
alias l="ls -CFGp"
@ -141,7 +140,7 @@ if [[ $UNAME != Darwin ]]; then
# (last -10 -w -x&)
fi
if [[ $UNAME = Darwin ]]; then
if [[ $UNAME == Darwin ]]; then
(who -H -u | head -n10 &)
(echo "")
(last -10 &)
@ -151,7 +150,6 @@ fi
# 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"
##### Environment 7RS56S #####
# Environment should be placed to .environment or .bash_environment.
@ -213,7 +211,7 @@ UNAME=$(uname)
CPUARCH=$(uname -p)
# 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/
echo 'Dpkg::Progress-Fancy "1";' >/etc/apt/apt.conf.d/99progressbar
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"
# Compatibility with my i3 alsactl mess
if [ -f ~/.config/asound.state ]
then
if [ -f ~/.config/asound.state ]; then
alias alsactl="\alsactl -f ~/.config/asound.state"
fi
@ -568,9 +565,7 @@ function geoip() {
## for unit193 ;)
## use command "ex" to extract any archive files.
## "ex package.zip" for example
function ex ()
{
function ex() {
if [ -f "$1" ]; then
case "$1" in
*.tar) tar xvf $1 ;;
@ -587,9 +582,11 @@ case "$1" in
DIR=${1%%_*.deb}
ar xv $1
mkdir ${DIR}
tar -C ${DIR} -xzvf data.tar.gz ;;
tar -C ${DIR} -xzvf data.tar.gz
;;
*.rpm) rpm2cpio $1 | cpio -vid ;;
*) echo ""${1}" cannot be extracted via extract()"
*)
echo ""${1}" cannot be extracted via extract()"
;;
esac
else
@ -673,13 +670,11 @@ cd
# This function fixes nodejs on Debian based systems.
# (Everything expects nodejs to be called as node, but it's not with Debian.)
fix-node() {
if [[ $USER = "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]]
then
if [[ $USER == "root" && -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node ]]; then
ln -s /usr/bin/nodejs /usr/local/bin/node
fi
mkdir -p $HOME/.local/bin
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]]
then
if [[ -f /usr/bin/nodejs && ! -f /usr/bin/node && ! -f /usr/local/bin/node && ! -f $HOME/.local/bin/node ]]; then
ln -s /usr/bin/nodejs $HOME/.local/bin/node
fi
}
@ -811,7 +806,6 @@ ssh-verify-file () {
ssh-keygen -Y verify -f $sshAllowedSigners -I $1 -n file -s $2.sig <$2
}
# Source files for miscannellious modifications.
# acme.sh

1
rc/zshrc Normal file → Executable file
View File

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