-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zsh_TagOS
263 lines (213 loc) · 9.83 KB
/
.zsh_TagOS
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
###################################################################################################
### term-coloring
###################################################################################################
### Pywal
## Import colorscheme from 'wal' asynchronously
## & # Run the process in the background.
## ( ) # Hide shell job control messages.
if [ -d ~/.cache/wal ]; then
(cat ~/.cache/wal/sequences &)
## Alternative (blocks terminal for 0-3ms)
cat ~/.cache/wal/sequences
## To add support for TTYs this line can be optionally added.
source ~/.cache/wal/colors-tty.sh;
fi
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### NEOFETCH Starting message
if [ -f /usr/bin/neofetch ]; then
neofetch;
fi
# Preferred editor for local and remote sessions
## TODO: modify remove connection to nano
##if [[ -n $SSH_CONNECTION ]]; then
## export EDITOR='emacs'
##else
## export EDITOR='emacs'
##fi
eval $(thefuck --alias wth)
###################################################################################################
### universal-aliases
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### modifying pre-existing commands
alias ls='ls --color -h --group-directories-first'
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### Universal commands
## quick list drives
alias drives='df -h'
## see space allocation in current folder
alias usage='du -h -d1'
## modified ls command
alias la='ls -al'
##
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
##
alias install_texts="fc-cache -f -v"
## flameshot - snipping tool
alias snipping="flameshot gui -p ~/Pictures/ -d 2500"
# ###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
# ### swapping caps-lock and ctrl
# ## https://www.youtube.com/watch?v=qPG5UrqOLUk
# alias swapKeys="setxkbmap -option ctrl:swapcaps"
# ## if setxkbmap exists, swap caps-ctrl.
# ## required for a functional zsh on headerless systems (ex, raspberry pi)
# if type "setxkbmap" > /dev/null; then
# setxkbmap -option ctrl:swapcaps
# fi
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### General functions
## cs function
# alias ls='ls --ignore-backups' # removes ~ backup files. seems to make file names whitewashed too.
function cs () {
cd $1
ls
}
###################################################################################################
### programming-aliases
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### python
alias myPyEnv="source ~/my_env/bin/activate"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### julia
export JULIA_PKG_SERVER=pkg.julialang.org
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### R
# alias avDataKeeping="cs $MYSTORAGE/my_journal/portfolio/playground/data-keeping/ ; Rscript ./data-keeping.R"
alias r="radian"
###################################################################################################
### Architecture specific
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### Arch systems
alias clearPacmanLock="sudo rm /var/lib/pacman/db.lck"
alias archDrives="cs /media"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### debian
debDrives="cs /media/${whoami}/"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### file managers
## universal
alias folder="xdg-open ./"
## enviroment specific
alias dolphin="dolphin . &"
alias thunar="thunar . &"
alias nautilus="nautilus . &"
###################################################################################################
### emacs
###################################################################################################
## DOCUMENTATION
## following commands require the emacsclient. Client is not started here.
### For rapid use emacs
alias ce="emacsclient -t"
### For opening an emacs programming GUI
alias cep="emacsclient -nc"
###################################################################################################
### staying organized
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### general functions
## For updating Org-monthly agenda details.
alias updateOrgMonthly="bash $MYSTORAGE/my_journal/linux-customization/scripts/org-monthly_auto.sh"
alias updateIcal="bash $MYSTORAGE/projects/calendar-app/clean-ics.sh"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### time functions
## simple
alias alarmTone="vlc /media/music/Christopher\ Tin\ -\ Sogno\ di\ Volare\ \(The\ Dream\ of\ Flight\)\ \(Civilization\ VI\ Main\ Theme\).mp3 && date"
alias alarmTime="termdown --no-figlet -T"
## functions
termCount() {
alarmTime "$1" "$2" && alarmTone
}
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### notifications
## Testing ways to get updated when terminals, remotely or # locally, complete a
## task. Approaches:
## - BASIC (myAlarm):
## Only works locally. Uses system notify.
##
## - SLACK (mySlackAlert):
## use slack to send a message. .Pyenviron holds slack
## information. Running commands with 'mySlackAlert' reads .Pyenviron for
## security details, sends a message using a slack bot.
## .Pyenviron not in .dotfiles due to its sensitive nature.
FILE=~/.Pyenviron && test -f $FILE && source $FILE
## myAlarm
## where $1 : message
## where $2 : message title
mA() {
notify-send "${2}" "${1}" --icon=dialog-information
}
alias qA="mA 'done' 'done'"
## mySlackAlert
mSA() {
curl -X POST -H 'Content-type: application/json' --data "{'text':'${1}'}" https://hooks.slack.com/services/"${2}"
}
alias qSA="mSA 'notify' $sl_wk"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### directory managment
## these functions are used to rapidly change file-names as needed.
## https://stackoverflow.com/questions/2709458/how-to-replace-spaces-in-file-names-using-a-bash-script
removeWhiteSpace() {
mv "$1" "${1// /_}"
}
removeUnderScores() {
mv "$1" "${1//_/ }"
}
###################################################################################################
### location-aliases
###################################################################################################
alias myNet="less $MYSTORAGE/net.txt"
###################################################################################################
### pi-aliases
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### Raspberry Pi related functions
## Very handy in finding raspberry pi ip, or any other ips on the network.
## taken from here:
## https://superuser.com/questions/872151/how-to-find-raspberry-pi-on-network
## arguments:
## -d for deluxe (finds only raspberry pi ip)
alias raspPiFinder="bash ~/.dotfiles/scripts/raspPiFinder.sh" # if given 'pi', returns the ip of any raspberry pis.
## functions when on the pi
alias temp='sudo /opt/vc/bin/vcgencmd measure_temp'
alias clock='vcgencmd measure_clock arm'
alias volt='vcgencmd measure_volts'
###################################################################################################
### document-templates
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### Document handlers
## rapid fire template generation
alias genCoverLetter="cp $MYSTORAGE/projects/templates/letters/coverletter/* ./"
alias genSimpleRmd="cp $MYSTORAGE/projects/templates/rmd/simple-template/* ./"
alias genShinyApp="cp $MYSTORAGE/projects/templates/rmd/shiny-app/* ./"
## aliases
alias mafo="make && folder"
alias mafoe="make && folder && exit"
### pandoc-aliases
#alias beamering="pandoc --pdf-engine=lualatex --template=template.latex -t beamer -o slides.pdf 01-Main.md"
alias beamering="pandoc --pdf-engine=lualatex -t beamer -o slides.pdf 01-Main.md"
alias resumeing="pandoc --pdf-engine=lualatex -o trial-something.pdf cv_4.tex"
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### functions
## for notes
## Will take a file, move it to my permanent storage, and save it there
## Will then symlink the file there to the current position.
## Used to deal with dropbox handling of symlinks and to make
## my life easier.
function symNote(){
mv ${1} $MYSTORAGE/org-files/notes/
ln -s $MYSTORAGE/org-files/notes/${1} ./
}
###################################################################################################
### blog
###################################################################################################
###<<<<<<<<<<<<<<<<<<<<<<<-------------------------------------------------------------------------
### lets make life easier
#alias cpPics='function _cpPics(){ cp "$1" ~/Documents/harappun-files-v1.1/images/};_cpPics'
# function mvBlogPost() {
# arg1=$1
# cp ./$1 ~/Documents/blog-hugo/content/post/
# rename -f 's/\.Rmd$/\.html/' $HOME/Documents/blog-hugo/content/post/$1
# }