-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
48 lines (38 loc) · 891 Bytes
/
.bash_aliases
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
alias 'aliases'='nano ~/.bash_aliases'
alias cls='clear'
alias open='xdg-open'
alias h='history'
### Keyboards###
alias 'key-pt'='setxkbmap -model abnt2 -layout br -variant abnt2'
alias 'key-us'='setxkbmap us'
#### PORT COMUNICATION ###
alias 'pty'='socat -d -d pty,echo=0,raw pty,echo=0,raw'
scrun() {
# speeds up the creation of scripts by running chmod.
# just call scrun + file name
file=$1
script="./\$file"
# help
if [[ "$1" == "-h" ]]; then
echo "speeds up the run of scripts by running chmod. just call scrun + file name"
return
fi
# check if arg is empty
if [[ $file == "" ]]; then
echo "Missing the filename"
return
fi
#copy if there are options
while [ -n "$1" ]; do
script="$script $1"
shift
done
# check if file alredy chmod
in=`ls -l $file`
if [[ $in == *"-rwxrwxr-x"* ]]; then
eval $script
else
chmod +x $file
eval $script
fi
}