Updating PKGBUILD; restructuring some aliases & functions

This commit is contained in:
2025-11-03 11:11:18 -06:00
parent f80c799ec9
commit cd920b33d3
5 changed files with 42 additions and 28 deletions

View File

@@ -1,6 +1,33 @@
### AniNIX Customizations ###
IFS="
"
# Text
alias vi=vim
alias view="vim -R"
alias notepad="vim -c 'set nonumber' -c 'startinsert'"
alias sedws='sed -i -e "s/\s\+$//"'
# Metrics & Tools
alias get-commands='for i in $( echo $PATH | sed "s/:/\n/g"); do ls $i; done | sort | less'
alias whoison='who | grep -v tmux'
alias top="top -o %CPU"
alias ethstat='curl rate.sx'
alias ncattest='ncat -vti 3 -w 3 -e "/bin/cat /dev/null"'
alias rdns="dig +short -x "
alias dns="dig +short "
# Development
alias make-entrypoints="grep -E '^[a-zA-Z0-9\-]*:' Makefile"
function calc() {
echo $(( $@ ))
}
# User environment
export WEECHAT_HOME=$HOME/.weechat
if [ -x `which torsocks 2>/dev/null` ] && [ `systemctl status tor 2>/dev/null| grep -c running` -eq 1 ]; then
alias tor-lynx="torsocks elinks https://check.torproject.org/";
fi
function vncdesktop() {
set -x
if [ -z "$@" ]; then
@@ -14,15 +41,7 @@ function vncdesktop() {
vncserver -kill "$DISPLAY"
set +x
}
alias vi=vim
alias view="vim -R"
alias top="top -o %CPU"
alias make-entrypoints="grep -E '^[a-zA-Z0-9\-]*:' Makefile"
alias rdns="dig +short -x "
alias dns="dig +short "
export WEECHAT_HOME=$HOME/.weechat
if [ -x `which torsocks 2>/dev/null` ] && [ `systemctl status tor 2>/dev/null| grep -c running` -eq 1 ]; then
alias tor-lynx="torsocks lynx https://check.torproject.org/";
alias stopvnc="vncserver -kill :1"
if [ -n "$DISPLAY" ]; then
alias cb='xclip -i -sel clip'
fi
IFS="
"

View File

@@ -2,6 +2,6 @@
source /etc/profile.d/shadowarch-shell-environment.sh
export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/password-store/${organization}.vault.password
export ANSIBLE_VAULT_FILE=$HOME/password-store/${organization}.vault
alias ansible="/usr/bin/ansible -e @${ANSIBLE_VAULT_FILE}"
alias ansible-playbook="/usr/bin/ansible-playbook -e @${ANSIBLE_VAULT_FILE}"
alias vault="/usr/bin/ansible-vault edit ${ANSIBLE_VAULT_FILE}"
alias ansible='/usr/bin/ansible -e @${ANSIBLE_VAULT_FILE}'
alias ansible-playbook='/usr/bin/ansible-playbook -e @${ANSIBLE_VAULT_FILE}'
alias vault='/usr/bin/ansible-vault edit ${ANSIBLE_VAULT_FILE}'

View File

@@ -1,7 +1,7 @@
# Set up screen/tmux safety nest by default for remote sessions
if [ -n "$SSH_CLIENT" ]; then
if [ -n "$SSH_CLIENT" ]; then
# Prefer tmux
if [ -x "$(which tmux 2>/dev/null)" ] && [ -z "$TMUX" ]; then
if [ -x "$(which tmux 2>/dev/null)" ] && [ -z "$TMUX" ]; then
if [ `tmux list-sessions | grep created | wc -l` -eq 0 ]; then
exec tmux
elif [ `tmux list-sessions | grep created | wc -l` -eq 1 ] && [ `tmux list-sessions | grep attached | wc -l` -eq 0 ]; then
@@ -10,7 +10,11 @@ if [ -n "$SSH_CLIENT" ]; then
tmux list-sessions
fi
alias tat="exec tmux a -d -t"
fi;
function tssh() {
tmux new-window -n "$1" "/bin/bash -i -l -c ssh\ $1"
tmux select-window -t "$1"
}
fi;
### XFCE4 ###
elif [ `who -m | grep -E "^$(whoami)" | awk '{ print $2; }' | grep -E -c "^tty"` -eq 1 ] && [ -x /usr/sbin/startxfce4 ] && [ `pgrep -ac xinit` -eq 0 ] && [ `whoami` != 'root' ]; then

View File

@@ -14,11 +14,6 @@ if [ -n "$SSH_AUTH_SOCK" ] && [ `ssh-add -L | grep -c no\ identities` -eq 1 ]; t
ssh-add -L
fi
# Tmux help
function tssh () {
tmux new-window -n "$1" "/bin/bash -ilc 'ssh $1'"
}
### GIT ###
source /usr/share/git/completion/git-prompt.sh
@@ -34,7 +29,7 @@ function git_prompt_var() {
### User-directory .gitbare Support (Git) ###
if [ -d ~/.git ]; then
cd
cd
printf "~/.git: "
if [ $SHLVL -eq 1 ] && [ -z "$TMUX" ]; then
git pull

View File

@@ -3,12 +3,8 @@ makedepends=('make>=4.2')
checkdepends=()
optdepends=()
pkgname="$(git config remote.origin.url | rev | cut -f 1 -d '/' | rev | sed 's/.git$//')"
pkgver="$(git describe --tag --abbrev=0)"."$(git rev-parse --short HEAD)"
pkgver="$(git describe --tag --abbrev=0)"."$(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 ))"."$(git rev-parse --short HEAD)"
pkgrel=1
pkgrel() {
echo $(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 ))
}
epoch="$(git log | grep -c commit)"
pkgdesc="$(head -n 1 README.md)"
arch=("x86_64")
url="$(git config remote.origin.url | sed 's/.git$//')"