openbsd config, MACHINE EV, dis caps, ksh, git
[dotfiles_afify.git] / .config / ksh / kshrc
blob2283bf152a17ed8322fbefdf4f5f0702d045a804
1 #!/bin/ksh
3 alias k='clear'
4 alias mv='mv -i'
5 alias cp='cp -ir'
6 alias rm='rm -i'
7 alias mkdir='mkdir -p'
8 alias xc='xclip -sel clip'
9 alias fonts="fc-list | sed 's/^.*: //' | sort"
10 alias lsb="dmesg | egrep '^(cd|wd|sd|fd). at '"
11 alias sc="rsync -avzhe ssh --progress"
13 [ "$(uname)" = "OpenBSD" ] &&\
14 alias ls='colorls -GA' ||\
15 alias ls='ls --color=always -A'
17 alias ll='ls -lh'
19 alias wgetf="wget --tries=100 --continue --content-disposition --trust-server-names -i"
20 alias egyb=" cd ~/downloads && python /mnt/data/dev/egybest_downloader/egybest_unix.py"
21 alias dwmrc='cd /mnt/data/hports/src/dwm-6.2/ && vim config.h'
22 alias strc='cd /mnt/data/hports/src/st-0.8.2/ && vim config.h'
23 alias sl='cd /mnt/data/hports/src/slstatus/ && vim config.h'
24 alias ya="youtube-dl -i --add-metadata -f bestaudio"
25 alias yv="youtube-dl -i --add-metadata -f webm"
26 alias yvp="youtube-dl -i --add-metadata -f webm -o \"%(autonumber)s-%(title)s.%(ext)s\""
28 [ "$(id -u)" = 0 ] && col="9m" || col="24m"
29 export PS1="\[\033[38;5;$col\]\W \033[38;5;166m\]\$(git branch --show-current 2>/dev/null)\[\033[00m\] "
31 ex(){
32 [ -f "$1" ] && case $1 in
33 *.tar.bz2) tar xjf "$1";;
34 *.tar.gz) tar xzf "$1";;
35 *.tar.xz) tar xf "$1";;
36 *.xz) xz -d "$1";;
37 *.bz2) bunzip2 "$1";;
38 *.rar) unrar x "$1";;
39 *.gz) gunzip "$1";;
40 *.tar) tar xf "$1";;
41 *.tbz2) tar xjf "$1";;
42 *.tgz) tar xzf "$1";;
43 *.zip) unzip "$1";;
44 *.7z) 7z x "$1";;
45 *.Z) uncompress "$1";;
46 *.tar.zst) tar -I zstd -xvf "$1";;
47 *) echo "'$1' cannot be extracted.";;
48 esac
51 comp(){
52 dir=$(basename "$1")
53 [ -f "$1" ] || [ -d "$1" ] && tar -czvf "$dir.tar.gz" -C "$1/.." "$dir"
56 fixp(){
57 [ -f "$1" ] || [ -d "$1" ] &&
58 find "$1" -type d -exec chmod 700 {} \; &&
59 find "$1" -type f -exec chmod 600 {} \;