#!/bin/bash # # BASH ALIASES # # Helper Functions exists() { command -v "$1" >/dev/null 2>&1 } # Better defaults alias ls="ls -hvF --group-directories-first --color=auto" alias rm="rm -iv" # Tree if exists tree; then alias tree="tree --dirsfirst" fi # Eza if exists eza; then alias ls="eza --group-directories-first \ --group --smart-group \ --git-repos" alias lss="ls -la --total-size" alias tree="ls --tree" fi # Git if exists git; then alias gs="git status" alias gc="git commit" alias gl="git log" alias gll="git log --all" alias gd="git diff" alias gds="git diff --staged" alias gu="git add --update" fi # TMUX if exists tmux; then function tmux() { if [ "$#" -eq 0 ]; then command tmux new-session -s "TMUX" else command tmux "$@" fi } fi # Podman if exists podman; then alias pd="podman" alias pdi="podman images ls" fi # Flatpak if exists flatpak; then alias flatpak="flatpak --user" alias fp="flatpak --user" fi # SSH if exists ssh-agent; then function ssh-on() { ssh-agent -k &>/dev/null eval "$(ssh-agent)" [ "$#" -eq 0 ] && duration=0 ssh-add -t "$duration" } function ssh-off() { ssh-agent -k } fi # Newsraft if exists newsraft; then alias news="newsraft -f ~/documents/feeds"; fi