Resolve #18, new 209/my_pc alias files, egc alias
- alias files: - 209: Split from school because was getting too long. - my_pc: Stores common aliases between laptop and desktop. - Can now have different Terminator configurations for each computer. - egc alias: Loads commit message buffer into Vim with text width of 72 and syntax highlighting.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
commit-msg.txt
|
||||||
*.sw*
|
*.sw*
|
||||||
temp.sh
|
temp.sh
|
||||||
konsole.shortcuts
|
konsole.shortcuts
|
||||||
|
|||||||
1
X1-Carbon-terminator
Symbolic link
1
X1-Carbon-terminator
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/kevin/.config/terminator/config
|
||||||
48
aliases/.209_aliases
Normal file
48
aliases/.209_aliases
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
alias ll="ls -l"
|
||||||
|
alias 209="$cd_school/209"
|
||||||
|
alias 9r="$cd_school/209/mokkar"
|
||||||
|
alias l4="$cd_school/209/mokkar/lab4"
|
||||||
|
alias a1="$cd_school/209/mokkar/a1"
|
||||||
|
# alias cdf="ssh -t mokkar@cdf.utoronto.ca '. ./.bashrc; bash -l'"
|
||||||
|
alias cdf="echo \". ./.bashrc\"&& ssh mokkar@cdf.utoronto.ca"
|
||||||
|
mkex() { chmod 700 $1 ; }
|
||||||
|
|
||||||
|
## compilation functions
|
||||||
|
|
||||||
|
# compile without running
|
||||||
|
c9() { gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" -lm ; }
|
||||||
|
|
||||||
|
# compile without running
|
||||||
|
c9a() {
|
||||||
|
for file in *; do
|
||||||
|
if [[ $file = *.c ]]; then
|
||||||
|
gcc -Wall -std=gnu99 -g -o "${file%.*}".out "$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# compile and run
|
||||||
|
c9r() { gc9 $1 && ./"${1%.*}.out" ; }
|
||||||
|
|
||||||
|
# compile and run with input
|
||||||
|
c9i() { gc9 $1 && ./"${1%.*}.out" < $2 ; }
|
||||||
|
|
||||||
|
# compile and run with input file
|
||||||
|
run() {
|
||||||
|
while read line; do
|
||||||
|
./$1 $line
|
||||||
|
done < $2
|
||||||
|
}
|
||||||
|
|
||||||
|
# compile a1p2 and test with simple case
|
||||||
|
ca12() {
|
||||||
|
gcc -Wall -std=gnu99 -g -o validate_sin.out validate_sin.c sin_helpers.c
|
||||||
|
./validate_sin.out 810620716
|
||||||
|
}
|
||||||
|
|
||||||
|
# compile a1p1 and test with simple case
|
||||||
|
ca1() {
|
||||||
|
gcc -Wall -std=gnu99 -g -o count_large.out count_large.c
|
||||||
|
# ll | ./count_large.out 4000
|
||||||
|
./count_large.out 0 rw------- < ll.txt
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
alias_folder="~/linux-config/aliases"
|
alias_folder="~/linux-config/aliases"
|
||||||
alias_type="school git pc laptop"
|
alias_type="school git pc laptop 209 my_pc"
|
||||||
for type in $alias_type; do
|
for type in $alias_type; do
|
||||||
. ~/linux-config/aliases/."$type"_aliases
|
. ~/linux-config/aliases/."$type"_aliases
|
||||||
done
|
done
|
||||||
@@ -13,6 +13,8 @@ alias reb="sudo shutdown -r 0"
|
|||||||
alias sd="sudo shutdown 0"
|
alias sd="sudo shutdown 0"
|
||||||
alias s="systemctl suspend"
|
alias s="systemctl suspend"
|
||||||
alias hst="history"
|
alias hst="history"
|
||||||
|
alias topo="top -o %MEM"
|
||||||
|
alias rmsw="rm .sw*"
|
||||||
|
|
||||||
# directories
|
# directories
|
||||||
# unalias c
|
# unalias c
|
||||||
@@ -31,8 +33,9 @@ ok() { okular $1 ; }
|
|||||||
# config
|
# config
|
||||||
alias lc="d ~/linux-config/"
|
alias lc="d ~/linux-config/"
|
||||||
alias lca="d ~/linux-config/aliases"
|
alias lca="d ~/linux-config/aliases"
|
||||||
alias vb="vi \"$alias_folder\"/.bash_aliases"
|
alias vb="vi $alias_folder/.bash_aliases"
|
||||||
alias vs="vi \"$alias_folder\"/.school_aliases"
|
alias vs="vi $alias_folder/.school_aliases"
|
||||||
|
alias vs9="vi $alias_folder/.209_aliases"
|
||||||
alias vv="vi ~/.vimrc"
|
alias vv="vi ~/.vimrc"
|
||||||
alias r=". ~/.bashrc"
|
alias r=". ~/.bashrc"
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,5 @@ gremotes() {
|
|||||||
git remote set-url --add --push origin $1
|
git remote set-url --add --push origin $1
|
||||||
git remote set-url --add --push origin $2
|
git remote set-url --add --push origin $2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alias egc="vim -c \"set syn=gitcommit\" -c \"set tw=72\" commit-msg.txt"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
if [ "$(hostname)" == "X1-Carbon" ]; then
|
if [ "$(hostname)" == "X1-Carbon" ]; then
|
||||||
|
# key swaps
|
||||||
xmodmap -e "keycode 9 = Escape"
|
xmodmap -e "keycode 9 = Escape"
|
||||||
xmodmap -e "keycode 22 = Home"
|
xmodmap -e "keycode 22 = Home"
|
||||||
xmodmap -e "keycode 119 = End"
|
xmodmap -e "keycode 119 = End"
|
||||||
|
|||||||
6
aliases/.my_pc_aliases
Normal file
6
aliases/.my_pc_aliases
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
if [ "$(whoami)" == "kevin" ]; then
|
||||||
|
alias vbn="cvlc --loop ~/Downloads/brown-noise.mp3"
|
||||||
|
|
||||||
|
alias mt="ok ~/Documents/School/136/calc-textbook.pdf"
|
||||||
|
alias 36t="ok ~/Documents/School/236/236-textbook.pdf"
|
||||||
|
fi
|
||||||
@@ -30,9 +30,6 @@ if [ "$(hostname)" == "NZXT" ]; then
|
|||||||
alias spt="speedtest"
|
alias spt="speedtest"
|
||||||
alias pg="ping -c 5 google.ca"
|
alias pg="ping -c 5 google.ca"
|
||||||
|
|
||||||
alias mt="ok ~/Documents/School/136/calc-textbook.pdf"
|
|
||||||
alias 36t="ok ~/Documents/School/236/236-textbook.pdf"
|
|
||||||
|
|
||||||
alias rcg="d ~/Documents/coding/random-color-generator"
|
alias rcg="d ~/Documents/coding/random-color-generator"
|
||||||
alias dcr="d ~/Documents/coding/dcr-logger"
|
alias dcr="d ~/Documents/coding/dcr-logger"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if $in_lab; then
|
|||||||
alias nau="nautilus ."
|
alias nau="nautilus ."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# school
|
# general
|
||||||
alias sch="$cd_school"
|
alias sch="$cd_school"
|
||||||
alias 236="$cd_school/236"
|
alias 236="$cd_school/236"
|
||||||
alias psy="$cd_school/psy"
|
alias psy="$cd_school/psy"
|
||||||
@@ -24,61 +24,8 @@ cptp() {
|
|||||||
date=`date +%-m-%d`
|
date=`date +%-m-%d`
|
||||||
mv cp-template.tex "$date".tex
|
mv cp-template.tex "$date".tex
|
||||||
}
|
}
|
||||||
|
|
||||||
# 136
|
# 136
|
||||||
alias 136="$cd_school/136"
|
alias 136="$cd_school/136"
|
||||||
alias 136n="$cd_school/136/notes"
|
alias 136n="$cd_school/136/notes"
|
||||||
alias pr2="$cd_school/136/par/2"
|
alias pr2="$cd_school/136/par/2"
|
||||||
|
|
||||||
# 209
|
|
||||||
alias ll="ls -l"
|
|
||||||
alias 209="$cd_school/209"
|
|
||||||
alias 9r="$cd_school/209/mokkar"
|
|
||||||
alias l4="$cd_school/209/mokkar/lab4"
|
|
||||||
alias a1="$cd_school/209/mokkar/a1"
|
|
||||||
# alias cdf="ssh -t mokkar@cdf.utoronto.ca '. ./.bashrc; bash -l'"
|
|
||||||
alias cdf="echo \". ./.bashrc\"&& ssh mokkar@cdf.utoronto.ca"
|
|
||||||
|
|
||||||
# compile without running
|
|
||||||
c9() {
|
|
||||||
gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" -lm
|
|
||||||
}
|
|
||||||
|
|
||||||
# compile without running
|
|
||||||
c9a() {
|
|
||||||
for file in *
|
|
||||||
do
|
|
||||||
if [[ $file = *.c ]]; then
|
|
||||||
gcc -Wall -std=gnu99 -g -o "${file%.*}".out "$file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
# compile and run
|
|
||||||
c9r() {
|
|
||||||
gc9 $1
|
|
||||||
./"${1%.*}.out"
|
|
||||||
}
|
|
||||||
# compile and run with input
|
|
||||||
c9i() {
|
|
||||||
gc9 $1
|
|
||||||
./"${1%.*}.out" < $2
|
|
||||||
}
|
|
||||||
# compile and run with input file
|
|
||||||
run() {
|
|
||||||
while read line
|
|
||||||
do
|
|
||||||
./$1 $line
|
|
||||||
done < $2
|
|
||||||
}
|
|
||||||
mkex() { chmod 700 $1 ; }
|
|
||||||
# temp
|
|
||||||
# compile a1p2 and test with simple case
|
|
||||||
ca12() {
|
|
||||||
gcc -Wall -std=gnu99 -g -o validate_sin.out validate_sin.c sin_helpers.c
|
|
||||||
./validate_sin.out 810620716
|
|
||||||
}
|
|
||||||
# compile a1p1 and test with simple case
|
|
||||||
ca1() {
|
|
||||||
gcc -Wall -std=gnu99 -g -o count_large.out count_large.c
|
|
||||||
# ll | ./count_large.out 4000
|
|
||||||
./count_large.out 0 rw------- < ll.txt
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ done
|
|||||||
|
|
||||||
# terminator
|
# terminator
|
||||||
term_dir=~/.config/terminator
|
term_dir=~/.config/terminator
|
||||||
rm $term_dir/config
|
pc=$(hostname)
|
||||||
ln $dot_dir/termConfig "$term_dir"/config
|
rm "$dot_dir"/"$pc"-terminator
|
||||||
|
ln -s "$term_dir"/config $dot_dir/"$pc"-terminator
|
||||||
|
|||||||
35
termConfig
35
termConfig
@@ -1,35 +0,0 @@
|
|||||||
[global_config]
|
|
||||||
inactive_color_offset = 1.0
|
|
||||||
title_font = Noto Sans 10
|
|
||||||
title_transmit_bg_color = "#3d3d3d"
|
|
||||||
[keybindings]
|
|
||||||
close_term = <Primary>w
|
|
||||||
cycle_next = <Shift>Tab
|
|
||||||
go_down = <Primary>j
|
|
||||||
go_left = <Primary>h
|
|
||||||
go_right = <Primary>l
|
|
||||||
go_up = <Primary>k
|
|
||||||
new_tab = <Primary>t
|
|
||||||
split_horiz = <Primary><Shift>e
|
|
||||||
split_vert = <Primary><Shift>o
|
|
||||||
[layouts]
|
|
||||||
[[default]]
|
|
||||||
[[[child1]]]
|
|
||||||
parent = window0
|
|
||||||
type = Terminal
|
|
||||||
[[[window0]]]
|
|
||||||
parent = ""
|
|
||||||
type = Window
|
|
||||||
[plugins]
|
|
||||||
[profiles]
|
|
||||||
[[default]]
|
|
||||||
background_image = None
|
|
||||||
copy_on_selection = True
|
|
||||||
cursor_color = "#b9b9b9"
|
|
||||||
custom_command = env TERM=xterm-256color bash
|
|
||||||
font = Monospace 8.5
|
|
||||||
foreground_color = "#0077ff"
|
|
||||||
palette = "#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"
|
|
||||||
scrollbar_position = hidden
|
|
||||||
use_custom_command = True
|
|
||||||
use_system_font = False
|
|
||||||
Reference in New Issue
Block a user