diff --git a/EtcFiles/profile.d/shadowarch-aliases.sh b/EtcFiles/profile.d/shadowarch-aliases.sh index 71e5dbf..42dad90 100644 --- a/EtcFiles/profile.d/shadowarch-aliases.sh +++ b/EtcFiles/profile.d/shadowarch-aliases.sh @@ -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=" -" diff --git a/EtcFiles/profile.d/shadowarch-ansible.sh b/EtcFiles/profile.d/shadowarch-ansible.sh index 6e3d02a..4ad9045 100644 --- a/EtcFiles/profile.d/shadowarch-ansible.sh +++ b/EtcFiles/profile.d/shadowarch-ansible.sh @@ -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}' diff --git a/EtcFiles/profile.d/shadowarch-session.sh b/EtcFiles/profile.d/shadowarch-session.sh index 1939e02..82a3923 100644 --- a/EtcFiles/profile.d/shadowarch-session.sh +++ b/EtcFiles/profile.d/shadowarch-session.sh @@ -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 diff --git a/EtcFiles/profile.d/shadowarch-ssh.sh b/EtcFiles/profile.d/shadowarch-ssh.sh index 8d69b51..65922f3 100644 --- a/EtcFiles/profile.d/shadowarch-ssh.sh +++ b/EtcFiles/profile.d/shadowarch-ssh.sh @@ -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 diff --git a/PKGBUILD b/PKGBUILD index 32a1ff2..1b1b9c8 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -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$//')"