summaryrefslogtreecommitdiff
path: root/.bashrc
blob: 7b3e317e0575588a4f94f6e2b827118485135135 (plain)
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
71
72
73
74
# .bashrc

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
alias grep='grep --color=auto'
PROMPT_DIRTRIM=0
PS1='\[\e[90m\][\u@\h \W]\$\[\e[0m\] '

shopt -s histappend
HISTCONTROL=ignoreboth

alias xqr='xbps-query -R'
alias xqrs='xbps-query -Rs'

bind -s 'set completion-ignore-case on'

runtimeify() {
	sudo mkdir /run/user/1000
	sudo chown rebecca:rebecca /run/user/1000
	sudo chmod 700 /run/user/1000
	export XDG_RUNTIME_DIR=/run/user/1000
}

alias kb='kak ~/.bashrc'
alias .b='source ~/.bashrc'

alias l='ls -lah'

export SSH_AUTH_SOCK=/run/user/1000/ssh-agent.sock
( pgrep -u $USER ssh-agent  || ssh-agent -a $SSH_AUTH_SOCK ; ) >/dev/null

export XDG_CONFIG_HOME=$HOME/.config
export EDITOR=kak

apwd () {
	pwd | sed -e 's!'"$HOME"'!~!'
}

alias mirror='mpv --untimed --profile=low-latency --vf=hflip /dev/video0'

set_title () { printf "\e]2;%s\e\\" "$1"; }
_lastcmd () { history 1 | sed -e 's/^ *[0-9]* *//g' ; }
trap 'set_title "$(_lastcmd)"' DEBUG
PROMPT_COMMAND='set_title "$(apwd)"'

export LUA_PATH_5_3="$HOME/.local/lib/lua/5.3/?.lua;;"
export LUA_PATH_5_1="$HOME/.local/lib/lua/5.1/?.lua;;"
export LUA_CPATH_5_3="$HOME/.local/lib/lua/5.3/?.so;;"
export LUA_CPATH_5_1="$HOME/.local/lib/lua/5.1/?.so;;"

export MANPATH="$HOME/.local/share/man:"

add_path () {
	export PATH="$1:$PATH"
}

shed () {
	# week year, week week
	wy=$(date +%G)
	ww=$(date +%V)
	d="$HOME/shed/$wy/w$ww"
	mkdir -p "$d"
	cd "$d"
	ln -sfT "$PWD" ~/shed/current

}

add_path ~/.local/bin
add_path ~/bin

. ~/bin/rws
gowork