-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_me
67 lines (55 loc) · 1.65 KB
/
.bash_me
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
#!/bin/bash
# Utility functions and aliases
function run() {
ulimit -s 512000
g++ -g --std=c++14 -Wall -Wshadow "$1" && ./a.out
}
alias c='xclip -selection clipboard'
export VISUAL=vim
export EDITOR=$VISUAL
# Tmux auto start
alias tx="tmux attach || tmux"
# Custom dircolors
eval $(dircolors ~/.dircolors)
if [[ $HOST == "nims-pc" ]]; then
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
fi
function latexmake(){
latexmk -pdf "$1" > /dev/null 2>&1
STATUS=$?
rubber-info --check "$1"
rubber-info --boxes "$1"
return $STATUS
}
function previewtex(){
EVINCE_OPEN=0
DIR=$(dirname "$1")
DIR=$(cd $DIR && pwd)
while true; do
latexmake "$1" < /dev/null
STATUS=$?
if [[ $EVINCE_OPEN == 0 ]]; then
if [[ $STATUS == 0 ]]; then
xdg-open "${1%%tex}pdf" &
EVINCE_OPEN=1
fi
fi
inotifywait -e close_write "$DIR"
done
}
function venv(){
. "$1"/bin/activate
}
alias uwvpn="sudo openconnect cn-vpn.uwaterloo.ca"
alias youtube-dl-aria="youtube-dl --external-downloader aria2c --external-downloader-args \"--file-allocation=falloc --min-split-size=1M --split=16 --max-connection-per-server=16\""
alias steam-wine='WINEDEBUG=-all wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-cef-sandbox >/dev/null 2>&1 &'
alias cpcmd='tmux setb "$(fc -ln -1 -1)"'
PATH=$HOME/.local/bin:$PATH
function new_entry() {
vim ~/diary/$(date -I"date")-"$1".md
}