From ac2e30499c6baad884d917dd0aa8b1b3e13e7ec7 Mon Sep 17 00:00:00 2001 From: Yuzucchii Date: Sat, 14 Jun 2025 17:18:24 -0500 Subject: [PATCH] xd --- .ashrc | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ .profile | 2 + 2 files changed, 186 insertions(+) create mode 100644 .ashrc create mode 100644 .profile diff --git a/.ashrc b/.ashrc new file mode 100644 index 0000000..98ce51d --- /dev/null +++ b/.ashrc @@ -0,0 +1,184 @@ +# Minimal epic ash shell - efficient and powerful + +# Core environment +export EDITOR='nvim' VISUAL='nvim' +export LANG="en_US.UTF-8" +export PATH="$HOME/.local/bin:$HOME/void-pilot:$HOME/go/bin:$HOME/scripts:$PATH" +export GOPATH="$HOME/go" +export SVDIR="$HOME/.local/service" +export XDG_RUNTIME_DIR="/run/user/$(id -u)" +export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus" +#export CC="zig cc" CXX="zig c++" CGO_ENABLED=1 +umask 077 + +# Start DBUS if needed +export $(dbus-launch) + +# Aliases - battle-tested efficiency +alias ls='ls --color=auto -F' +alias ll='ls -lh' +alias la='ls -A' +alias lt='ls -lhtr' +alias rm='rm -i' cp='cp -i' mv='mv -i' +alias rmdir='rmdir -v' +alias @='cd' +alias ..='cd ..' ...='cd ../..' ....='cd ../../..' +alias c='clear' q='exit' +alias du='du -h' df='df -h' + +# XBPS - Void's lightning arsenal +alias xd='doas xbps-install -Sy' +alias xu='doas xbps-install -Su' +alias xs='doas xbps-install -S' +alias xr='doas xbps-remove -R' +alias xq='xbps-query' +alias xf='xbps-query -s' +alias xro='doas xbps-remove -Oo' # Remove orphans +alias xclean='doas vkpurge rm all' # Clean old kernels + +# Zig supremacy +export PATH="$HOME/.zig/zig-x86_64-linux-0.15.0-dev.769+4d7980645/:$PATH" +alias zbr='zig build run' +alias zb='zig build -Doptimize=ReleaseFast' +alias zbs='zig build -Doptimize=ReleaseSafe' +alias zbw='zig build run --watch -fincremental' +#alias cc="zig cc" c++="zig c++" gcc="zig cc" g++="zig c++" + +# Git essentials +alias gs='git status --short' +alias ga='git add' +alias gap='git add --patch' +alias gc='git commit' +alias gca='git commit --amend' +alias gp='git push' +alias gu='git pull' +alias gb='git branch' +alias gd='git diff --output-indicator-new=" " --output-indicator-old=" "' +alias gds='git diff --staged --output-indicator-new=" " --output-indicator-old=" "' +alias gco='git checkout' +alias gcl='git clone' +alias gl='git log --all --graph --pretty=\ + format:"%C(yellow)%h%Creset %C(green)(%ar)%Creset %C(bold blue)%d%Creset %s" ' + +# Mercurial giga chad commands +alias hgs='hg status' +alias hgd='hg diff' +alias hgl='hg log -l 5 --template "{node|short} | {date|isodate} | {desc|firstline}\n"' +alias hgc='hg commit' +alias hgp='hg push' +alias hgu='hg pull -u' +alias hgb='hg branch' +alias hgba='hg branches' +alias hgco='hg checkout' +alias hgnew='hg init' + +# System reconnaissance +alias myip='curl -s ifconfig.co' +alias ports='ss -tulpn' +alias meminfo='free -h' +alias diskreport='df -hT / /home' +alias sysreboot='doas shutdown -r now' +alias sysoff='doas shutdown -P now' + +# Enhanced tools +alias grep='grep --color=auto' +alias mkdir='mkdir -pv' +alias history='history 25' +alias pkgcount='xbps-query -l | wc -l' + +# Safety first +alias ln='ln -i' +alias chmod='chmod -v' +alias chown='chown -v' + +# Wofi warriors +alias powermenu="$HOME/.config/wofi/scripts/power.sh" +alias emojipicker="$HOME/.config/wofi/scripts/emojis.sh" +alias bluetoothmenu="$HOME/.config/wofi/scripts/bluetooth.sh" + +export PS1="\e[32m\u\[\e[0m\]@\[\e[33m\]\h\[\e[0m\]:\[\e[34m\] \W\[\e[35m\] シスコン \[\e[0m\]" + +hg_branch() { + if [ -d .hg ] || hg root >/dev/null 2>&1; then + echo " (branch: $(hg branch))" + fi +} + +# Core utilities -------------------------------------------------------- + +# Create and enter directory +mcd() { mkdir -p "$1" && cd "$1"; } + +# Archive extraction wizard +extract() { + [ -z "$1" ] && echo "Usage: extract " && return 1 + [ ! -f "$1" ] && echo "File not found" && return 1 + case "$1" in + *.tar.bz2|*.tbz2) tar xvjf "$1" ;; + *.tar.gz|*.tgz) tar xvzf "$1" ;; + *.bz2) bunzip2 "$1" ;; + *.rar) unrar x "$1" ;; + *.gz) gunzip "$1" ;; + *.tar) tar xvf "$1" ;; + *.zip) unzip "$1" ;; + *.Z) uncompress "$1" ;; + *.7z) 7z x "$1" ;; + *) echo "Unsupported format" && return 1 ;; + esac +} + +# Create compressed tarball +targz() { + [ -z "$2" ] && echo "Usage: targz " && return 1 + tar cvzf "$1" "$2" +} + +# GNU bloat report +bloat_report() { + echo "GNU packages:" + xbps-query -l | grep -i "gnu" | cut -d" " -f2 | sort + echo "\nTotal GNU packages: $(xbps-query -l | grep -i "gnu" | wc -l)" +} + +# Update system and clean +void_up() { + doas xbps-install -Su + doas xbps-remove -Oo + doas vkpurge rm all +} + +# Edit and reload profile +alias erc='nvim ~/.profile' +alias reload='. ~/.profile' + +# Backup files with timestamp +bak() { cp -iv "$1" "${1}_$(date +%Y%m%d%H%M).bak"; } + +# Start SSH Agent +#---------------------------- + +SSH_ENV="$HOME/.ssh/environment" + +function run_ssh_env { + . "${SSH_ENV}" > /dev/null +} + +function start_ssh_agent { + echo "Initializing new SSH agent..." + ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" + echo "succeeded" + chmod 600 "${SSH_ENV}" + + run_ssh_env; + + ssh-add ~/.ssh/id_ed25519; +} + +if [ -f "${SSH_ENV}" ]; then + run_ssh_env; + ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + start_ssh_agent; + } +else + start_ssh_agent; +fi diff --git a/.profile b/.profile new file mode 100644 index 0000000..78222c1 --- /dev/null +++ b/.profile @@ -0,0 +1,2 @@ +export ENV=$HOME/.ashrc; +. $ENV