summaryrefslogtreecommitdiff
path: root/shrc
blob: 876f8d42fc8cdb05d73499d13c3b3d549badf9fa (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
 # be paranoid
alias rm='rm -i'

alias grep="ugrep --exclude-dir=node-modules --exclude-dir=_build"
alias e="$EDITOR"
alias g="git"
alias grep="ugrep"
alias tldr="NO_COLOR=1 tldr"
alias dedoc="dedoc --color off"
alias doc="dedoc --color off search"
alias kill-sessions="tmux kill-session -a"
alias restart-wifi="doas /usr/sbin/service netif restart"
alias de='. ./.envrc'

optimizeimg() {
	convert -strip -quality 85% $1 $2
}


killunattached() {
	tmux list-sessions -F '#{session_attached} #{session_id}' | \
		awk '/^0/{print $2}' | \
		xargs -n 1 tmux kill-session -t
}

refs() {
	recsel -q $1 ~/personal-db/refs.rec
}

# Remove trailing newlines
cleartrail() {
	cat $1 | tr -d '\n'
}

addref() {
	$EDITOR /tmp/description
	cat /tmp/description | xargs -I {} recins refs.rec -f Title -v $1 -f Tags -v $2 -f Text -v {} 
}

isrootprompt() {
	CURR="$(id -u)"
	case "$CURR" in
	"0") echo "#"
	;;
	*) echo "$"
	;;
	esac
}

notes() {
	grep -i "$1" --format='%f%~' ~/notes/ | xargs -I {} cat {}
}


echo "BAT: $(apm -l), $(apm -b)"

set -o vi

eval "$(direnv hook bash)"

PS1='${PWD##*/} $(isrootprompt) '
eval "$(zoxide init posix --hook prompt)"




[ $(tty) == "/dev/ttyv0" ] && exec startx