# -*- mode: sh -*- if [ "$DESKTOP_SESSION" = i3 -o "$XDG_CURRENT_DESKTOP" = sway ] \ && command -v emacs >/dev/null; then EDITOR="emacsclient -c"; VISUAL="$EDITOR" fi ls --version 2>/dev/null | grep -q "GNU coreutils" \ && alias ls="ls --color=auto --literal --classify" grep --version 2>/dev/null | grep -q "GNU grep" \ && alias grep="grep --color=auto" alias doas="doas " alias sudo="sudo " alias e="$EDITOR" alias d="emacsclient -te '(dired \".\")'" alias ta="tmux new-session -A -s default -c ~" alias rax="screen -URaAx" alias mrs="src-register-all && mr -m status" alias gdbmacs="emacsclient -tc -sgdbmacs" alias g="git" alias ga="git annex" alias a2ac="annex-to-annex --commit" # useful to check whether a rebase introduced any changes to files alias rld="git diff @{1}..@{0}" alias athvpn="sshuttle -r athena 0/0 --dns" alias grepcopy="grep --color=always -Eir '(copyright|©)' * | less -R" alias dlp="lp -o sides=two-sided-long-edge" alias arsync="rsync -aSHAXc --partial --numeric-ids --info=progress2" alias axrsync="rsync -aSHAXxc --partial --numeric-ids --info=progress2" # To have a terminal emulator exit upon remote tmux detach, like my C-i s. alias sshta="exec ssh-and-tmux" alias pdd="dd bs=4M status=progress conv=fdatasync" upenv () { # don't want to do this outside of tmux as then tmux show-environment will # show values for the 'default' session which may be irrelevant to us if [ -n "$TMUX" ]; then local IFS=$'\n' for var in $(tmux show-environment | grep -v "^-"); do eval "export \"$var\"" done fi emacsclient --spw/no-start --spw/update-environment emacsclient -sgdbmacs --spw/no-start --spw/update-environment } #### Host-specific: ftp-master.debian.org #### if [ -d "/srv/ftp-master.debian.org" ]; then alias newlocks="cd /srv/ftp-master.debian.org/lock/new/ && ls -l" newlock () { touch /srv/ftp-master.debian.org/lock/new/"$1" } newunlock () { rm /srv/ftp-master.debian.org/lock/new/"$1" } pn () { cd /srv/ftp-master.debian.org/queue/new # We need VISUAL=emacsclient because dak's utils.call_editor fails # when VISUAL contains both the editor's name and arguments like -t. if [ -n "$1" ]; then VISUAL=emacsclient dak process-new "$1"*changes else VISUAL=emacsclient dak process-new -b fi } fi