-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.shellrc
77 lines (65 loc) · 1.8 KB
/
.shellrc
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
75
76
77
# This is designed to be a common script for bash and zsh to run on
# initialization
alias sx='startx'
alias g='git'
alias v='f -e vim -b viminfo'
alias no='yes n'
alias ka='killall'
alias ls='ls -B --color=auto'
alias ll='\ls -Blh --color=auto'
alias la='\ls -lAh --color=auto'
alias l='\ls -Blh --color=auto'
alias "cd~"='cd ~'
alias "cd.."='cd ..'
alias "cd..."='cd ../..'
alias "cd...."='cd ../../..'
alias "cd....."='cd ../../../..'
alias grep='grep --color=auto'
alias shred='shred -z'
alias "jk:wq"="echo You\'re not in vim."
alias ":wq"="echo You\'re not in vim."
alias "jk:w"="echo You\'re not in vim."
alias ":w"="echo You\'re not in vim."
alias "jk:q"="echo You\'re not in vim."
alias ":q"="echo You\'re not in vim."
alias sp='systemctl suspend'
alias hsp='systemctl hybrid-sleep'
alias xsp='xlock& sleep 2; systemctl suspend'
alias xhsp='xlock& sleep 2; systemctl hybrid-sleep'
alias fuck='eval "$(thefuck "$(fc -ln -1 | tail -n 1)")"; fc -R'
alias FUCK=fuck
if hash fasd 2>/dev/null; then
eval "$(fasd --init auto)"
fi
init_ssh_agent()
{
local file=/tmp/deb38eea2f69cc8698d05ac827f00c608b715a5a
local pid="$(pgrep -u "$USER" -o ssh-agent)" file_exists=false
[ -S "$file" ] && file_exists=true
if [ -n "$pid" ] && $file_exists; then
export SSH_AUTH_SOCK="$file"
export SSH_AGENT_PID="$pid"
return
fi
if [ -z "$pid" ] && $file_exists; then
env rm -f "$file"
elif [ -n "$pid" ] && ! $file_exists; then
killall -u "$USER" ssh-agent
fi
eval "$(ssh-agent -s -a "$file")"
ssh-add
}
init_redshift()
{
if [ -z "$DISPLAY" ] \
|| ! hash redshift 2>/dev/null \
|| [ -n "$(pgrep -u "$USER" -o redshift)" ]
then
return
fi
nohup redshift &>/dev/null &
disown
}
init_ssh_agent
init_redshift
# vim:set ft=sh: