summary refs log tree commit diff
path: root/.profile
blob: 50b4e6d9d87425db1f6e0419f5d43a3f56aa73fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# set xdg runtime dir if it's not defined
if [ -z "${XDG_RUNTIME_DIR}" ]; then
	export XDG_RUNTIME_DIR=/run/user/"$(id -u)"
	if [ ! -d "${XDG_RUNTIME_DIR}" ]; then
		mkdir -p "${XDG_RUNTIME_DIR}"
		chmod 0700 "${XDG_RUNTIME_DIR}"
	fi
fi
# set xdg cache dir if it's not defined
if [ -z "${XDG_CACHE_DIR}" ]; then
	export XDG_CACHE_DIR=/tmp/"$(id -un)"/.cache
	if [ ! -d "${XDG_CACHE_DIR}" ]; then
		mkdir -p "${XDG_CACHE_DIR}"
		chmod 0700 "${XDG_CACHE_DIR}"
	fi
fi

if [ -d "${HOME}/bin" ]; then
	pathprepend "${HOME}/bin"
	pathprepend "${HOME}/bin/$(uname -n)"
fi

if [ -d "${HOME}/AppImages" ]; then
	pathappend "${HOME}/AppImages"
fi

export GOPATH="${HOME}/go"
if [ -d "${GOPATH}" ]; then
	pathappend "${GOPATH}/bin"
fi

if [ -d "${HOME}/.cargo/bin" ]; then
	pathappend "${HOME}/.cargo/bin"
fi

# Use the new build backend in docker
export DOCKER_BUILDKIT=1

# Parallel portage
export NUMCPUS=$(nproc)
export NUMCPUSplusone=$((NUMCPUS + 1))
export MAKEOPTS="-j${NUMCPUSplusone} -l${NUMCPUS}"
export EMERGE_DEFAULT_OPTS="--jobs=${NUMCPUSplusone} --load-average=${NUMCPUS}"

# Set prompt
export PS1="$(prompt)"
# enlable vi mode
set -o vi
bind -m vi-insert -x '"\C-l": clear'

# Set less default options
export LESS='--hilite-search --hilite-unread --long-prompt --raw-control-chars --chop-long-lines --quit-if-one-screen --no-init'

# Set the rsync ssh command to use by default
export RSYNC_RSH='ssh -T -x -o Compression=no'

# Alias shell commands
# alias logout='dbus-send --session --type=method_call --print-reply --dest='
alias rm='rm -I'
alias vim=nvim
alias v=nvim
alias l='exa --long --classify --group --header --group-directories-first'
alias ..='cd ..'
alias ssh='TERM=xterm-256color ssh'
alias rsyncez='rsync --verbose --archive -hhh --partial --progress --stats --protect-args --rsh="ssh -o Compression=no"'
alias webcam='mpv --profile=webcam av://v4l2:/dev/video0'
alias balssh='ssh -p 22222 -o User=root -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
alias balscp='scp -P 22222 -o User=root -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
alias k=kubectl