.dotfiles/.aliases
2023-11-23 13:49:23 +01:00

31 lines
1.1 KiB
Plaintext

alias o="xdg-open"
alias pro="cd ~/Documents/Projects"
alias doc="cd ~/Documents"
alias blog="cd ~/Documents/Projects/myself/log/"
alias course="cd ~/Documents/course/master/M1/T1/"
# Print field name from header with the field rank
csv_fields() {
local delimiter
delimiter="${2:-\t}"
local file
file="${1}"
head -n 1 "${file}" | tr "${delimiter}" "\n" | awk '{print NR, $0}'
}
alias edit="$VISUAL"
export templates_dir="~/Documents/Projects/templates"
alias new.td='copier "$templates_dir/latex/td.template"'
alias new.cm='copier "$templates_dir/latex/cm.template"'
alias new.letter='copier "$templates_dir/latex/letter.template"'
pdfcompress () {
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile="$2" "$1";
}
colorinvert() {
convert "$1" -channel RGB -negate "$(echo $1 | sed 's/\./-inv\./')"
}