-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_commands
85 lines (67 loc) · 2.16 KB
/
.bash_commands
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
78
79
80
81
82
83
84
85
#!/bin/bash
shopt -s expand_aliases
alias vim="vim --servername vim"
alias play="mplayer -framedrop"
alias rm="rm -i"
# TODO improve this
alias resolution_lazy="xrandr --output eDP-1 --mode 1024x576"
alias resolution_low="xrandr --output eDP-1 --mode 1360x768"
alias resolution_high="xrandr --output eDP-1 --mode 1920x1080"
alias projector_activate='xrandr --output HDMI-2 --auto --above eDP-1 --mode 1920x1080'
alias projector_deactivate='xrandr --output HDMI-2 --off'
alias screen_work_activate='xrandr --output DP-2-1 --auto --left-of eDP-1 --rotate left'
alias screen_work_deactivate='xrandr --output DP-2-1 --off'
alias screen_home_activate='xrandr --output DP-2-2 --auto --right-of eDP-1'
alias screen_home_deactivate='xrandr --output DP-2-2 --off'
alias soundcontrol='pavucontrol &'
alias darklock="i3lock -f -c '222222'"
alias l='ls --color=auto'
alias ls='ls --color=auto'
alias la='ls -a --color=auto'
alias ll='ls -l --color=auto'
alias lla='ls -la --color=auto'
alias back='cd -'
alias ..='cd ..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias ungrep='grep -v --color -n'
alias grep='grep --color'
alias ngrep='grep --color -n'
alias rgrep='rgrep -I --color -n'
alias igrep='grep -i -I --color -n'
alias rigrep='rgrep -i -I --color -n'
alias egrep='egrep --color -I -n'
alias fgrep='fgrep --color -I -n'
alias sourcebashrc='source ~/.bashrc'
alias mplayeraudio='mplayer -novideo '
alias sshagent='eval `ssh-agent`; ssh-add'
function line() {
cat $1 |head -n $2|tail -n 1
}
function setbrightness(){
OUT="$(xrandr --listactivemonitors | awk 'NR!=1{print " "$NF" "}')"
for i in ${OUT};
do
xrandr --output "${i}" --brightness "$1"
done
}
function setinvert(){
OUT="$(xrandr --listactivemonitors | awk 'NR!=1{print " "$NF" "}')"
for i in ${OUT};
do
xrandr --output "${i}" --gamma -1:-1:-1 --brightness 0.3
done
}
function setrevert(){
OUT="$(xrandr --listactivemonitors | awk 'NR!=1{print " "$NF" "}')"
for i in ${OUT};
do
xrandr --output "${i}" --gamma 1:1:1 --brightness 0.5
done
}
function searchnotebook() {
NBDIR=$(ls -d ~/mygit/notebook)
grep -r "$1" ${NBDIR} | sed "s#${NBDIR}/##"
}