Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

460 lines
10 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # system {{{ #
  2. # vim: fdm=marker
  3. # clear screen
  4. c "printf '\033c'"
  5. hst "history"
  6. nf "printf '\033c' && neofetch | lolcat"
  7. fi "fish"
  8. # reload urxvt
  9. ru "xrdb ~/.Xresources"
  10. # list file sizes in megabytes with depth 1
  11. duh "sudo du -d 1 -h --apparent-size | sort -hr"
  12. dum "sudo du -d 1 -m --apparent-size | sort -hr"
  13. m "man"
  14. tl "tldr"
  15. nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
  16. vgb "sudo nvim /etc/default/grub"
  17. mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  18. b "bat"
  19. ba "bat *"
  20. grep "grep --color=auto -n"
  21. grr "grep -r"
  22. # pk "pkill -f"
  23. cld "colordiff -wy --suppress-common-lines"
  24. mkpk "makepkg -sri"
  25. ex "chmod 777"
  26. ex "chmod 777"
  27. # systemctl {{{ #
  28. ctl "sudo systemctl"
  29. ctle "sudo systemctl enable"
  30. ctld "sudo systemctl disable"
  31. ctla "sudo systemctl start"
  32. ctls "sudo systemctl stop"
  33. ctlt "sudo systemctl status"
  34. ctltd "sudo systemctl status dhcpcd"
  35. ctlr "sudo systemctl restart"
  36. # }}} systemctl #
  37. wm "sudo wifi-menu"
  38. # mounting
  39. udm "udisksctl mount -b"
  40. udmb "udisksctl mount -b /dev/sdc2"
  41. udu "udisksctl unmount -b"
  42. udub "udisksctl unmount -b /dev/sdc2"
  43. tc "touch"
  44. vdr "vidir"
  45. # directory-related {{{ #
  46. ls "lsd"
  47. l "lsd -a"
  48. ll "lsd -al"
  49. smv "sudo mv"
  50. f "cd"
  51. fz "fzf"
  52. fnd "find . -type f -name"
  53. rmr "rm -rf"
  54. rmd "rm ~/Downloads/*"
  55. rmw "rm ~/.local/share/nvim/swap/"
  56. md "mkdir -p"
  57. rsy "rsync -Pr"
  58. # list all (un)mounted drives
  59. lhd "sudo fdisk -l"
  60. # get disc space for mounted drives
  61. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  62. ds "df -h | head -n 1 && df -h | grep sd"
  63. chownw "sudo chown -R kevin:wheel"
  64. chwnm "sudo chown -R kevin:wheel /run/media/kevin"
  65. # cd into backup folder and show backup sizes
  66. nbu "cd /run/media/kevin/backup-hd/nzxt/tar && lsd -l"
  67. # }}} directory-related #
  68. # power options {{{ #
  69. s "systemctl suspend"
  70. so "xset dpms force off"
  71. sd "systemctl poweroff"
  72. rb "systemctl reboot"
  73. lo "i3-msg exit"
  74. x "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  75. X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  76. # }}} power options #
  77. # sound
  78. vlm "alsamixer -c 0"
  79. vlh "alsamixer -c 2"
  80. # apt
  81. # apti "sudo apt install"
  82. # aptr "sudo apt remove"
  83. # aptu "sudo apt upgrade"
  84. # pacman {{{ #
  85. # pc "sudo pacman -S"
  86. # pcq "sudo pacman -Qi"
  87. # pcr "sudo pacman -Rns"
  88. # pcud "sudo pacman -Sy"
  89. # pcug "sudo pacman -Syu"
  90. # xpc "pacman -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && pacman -Qqme > ~/linux-config/txt/nzxt-aur.txt "
  91. # tri "trizen -S --noconfirm"
  92. tri "trizen -S --noedit"
  93. # install
  94. ya "yay -S --answerdiff=N --answeredit=N"
  95. # info
  96. yaq "yay -Qi"
  97. # remove
  98. yar "yay -Rns"
  99. # sync
  100. yaud "yay -Sy"
  101. # sync and update
  102. yaug "yay -Syu"
  103. # export packages
  104. xya "yay -Qqne > ~/linux-config/txt/nzxt-pkgs.txt && yay -Qqme > ~/linux-config/txt/nzxt-aur.txt "
  105. # }}} pacman #
  106. py "python"
  107. pipi "sudo pip install"
  108. # internet
  109. pg "ping -c 3 -W 1 8.8.8.8"
  110. dh "sudo dhcpcd"
  111. kdh "sudo killall dhcpcd"
  112. rdh "sudo killall dhcpcd && sudo dhcpcd"
  113. id "identify"
  114. # rz "source ~/linux-config/aliases/zsh_aliases"
  115. # }}} system #
  116. # applications {{{ #
  117. # silent="> /dev/null 2>&1& "
  118. chr "google-chrome"
  119. clc "cloc ."
  120. cv "cava"
  121. fh "feh"
  122. gpd "gpg --decrypt"
  123. gpe "gpg --encrypt --recipient"
  124. htc "htop -s PERCENT_CPU"
  125. htm "htop -s PERCENT_MEM"
  126. kd "killall Discord && killall Discord"
  127. kt "killall thunderbird"
  128. mp "mpv --volume=50"
  129. mra "man ranger"
  130. n "nvim"
  131. p3 "python3"
  132. pdft "pdftotext"
  133. pipes "pipes.sh -t 3"
  134. py "python"
  135. r "ranger"
  136. rx "redshift -x"
  137. sn "sudo nvim"
  138. sx "sxiv"
  139. sxa "sxiv -a"
  140. sxt "sxiv -t *"
  141. vmd "vimdiff"
  142. wg "wego"
  143. wp "grep wallpaper ~/.cache/wal/colors.sh"
  144. z "zathura --fork"
  145. lz "unzip -l"
  146. # rsl "java -jar ~/Downloads/RuneLite.jar"
  147. # swex "sudo nohup ~/Downloads/swex.appimage $silent"
  148. # pass {{{ #
  149. ps "pass"
  150. psc "pass -c"
  151. pse "pass edit"
  152. psi "pass insert -m"
  153. psg "pass generate -c"
  154. pss "pass show"
  155. xc "xclip -selection clipboard"
  156. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  157. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  158. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  159. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  160. # }}} pass #
  161. # watson {{{ #
  162. w "watson"
  163. wa "watson start"
  164. wae "watson start && watson edit"
  165. we "watson edit"
  166. wl "watson log --day"
  167. wla "watson log --all --tag="
  168. ww "watson log"
  169. # wlm "watson log --project coding --tag mfs"
  170. wr "watson report --day"
  171. wrw "watson report"
  172. wre "watson restart"
  173. wree "watson restart && watson edit"
  174. ws "watson status && watson stop"
  175. wse "watson stop && watson edit"
  176. wsc "watson cancel"
  177. wsl "watson stop && watson log --day"
  178. wt "watson status"
  179. # }}} watson #
  180. # }}} applications #
  181. # git {{{ #
  182. gstr "git config credential.helper store"
  183. g "git"
  184. # branch {{{ #
  185. gb "git branch"
  186. gbd "git branch -D"
  187. gba "git branch --no-merged && echo '' && git branch --merged"
  188. gbu "git branch --no-merged"
  189. gbm "git branch --merged"
  190. gmg "git merge"
  191. gmgt "git mergetool"
  192. # }}} branch #
  193. gr "git remote -v"
  194. gro "git remote show origin"
  195. # add/remove {{{ #
  196. ga "git add -A && git status -u"
  197. gac "git add -A && git commit -S"
  198. gaf "git add -f"
  199. # unsigned commt
  200. gacu "git add -A && git commit"
  201. grm "git rm"
  202. grmf "git rm -f"
  203. grmc "git rm --cached"
  204. grmfc "git rm -f --cached"
  205. grmor "rm (fd -e orig --no-ignore -H)"
  206. # }}} add #
  207. # diff/log {{{ #
  208. gd "git difftool -w --tool=vimdiff"
  209. gdc "git difftool -w --cached --tool=vimdiff"
  210. gdl "git diff -w"
  211. gdlc "git diff --cached -w"
  212. gdh "git diff --cached -w HEAD~1"
  213. gds "git diff --stat"
  214. gl "git log"
  215. gsl "git shortlog"
  216. # }}} diff/log #
  217. # update {{{ #
  218. gs "git status -u"
  219. gchom "git checkout master"
  220. gchnw "git checkout -b wip"
  221. gchw "git checkout wip"
  222. gheadm1 "git reset --hard HEAD~1"
  223. # show files in git repo
  224. # gls "git ls-tree -r HEAD --name-only"
  225. gls "git ls-tree HEAD --name-only"
  226. # push {{{ #
  227. gst "git stash"
  228. gstl "git stash list"
  229. gstp "git stash pop"
  230. gc "git commit -S"
  231. gcu "git commit"
  232. gca "git add -A && git commit --amend --no-edit -S"
  233. gcam "git add -A && git commit --amend -S"
  234. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  235. psgi "git add -A && git commit -m 'Update' -S && git push"
  236. gps "git push"
  237. gpsi "git config credential.helper store && git push"
  238. # gpsn "git push --set-upstream origin master"
  239. gpsn "eval (git push 2>&1 | tail -n 2)"
  240. gpsf "git push --force"
  241. gclear "git stash clear"
  242. gpl "git pull --rebase"
  243. grba "git rebase --abort"
  244. grbc "git rebase --continue"
  245. # }}} push #
  246. # }}} update #
  247. crm "mrk README.md"
  248. gcho "git checkout"
  249. gchon "git checkout -b"
  250. gf "git fetch origin"
  251. gcln "git clone"
  252. gchp "git cherry-pick"
  253. gchpc "git cherry-pick --continue"
  254. # assume file unchanged
  255. gunc "git update-index --assume-unchanged"
  256. # }}} git #
  257. # coding projs {{{ #
  258. # coding_dir="~/coding"
  259. rgt "rg TODO"
  260. # trapbot {{{ #
  261. # tb "$cd_coding_dir/trapbot"
  262. # vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
  263. # ptb "python scan_reddit.py"
  264. # rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
  265. # }}} trapbot #
  266. # spotify-lib-vis {{{ #
  267. # spv_dir="$coding_dir""/spotify-lib-vis"
  268. # svl "f $spv_dir/src/login"
  269. # sva "f $spv_dir/src/api"
  270. # svg "f $spv_dir/src/graphs"
  271. # svscs "f $spv_dir/src/static/scss"
  272. # svcss "f $spv_dir/src/spotifyvis/static/scss"
  273. # start spv server from dir
  274. # pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
  275. ssv "bash ../bin/activate && python manage.py runserver"
  276. # start spv server outside dir
  277. # open spv db in psql
  278. spvdb "psql -d spotifyvis -U django"
  279. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  280. cldb "python manage.py flush --no-input && ssv"
  281. # django shell
  282. djs "python manage.py shell"
  283. # update pip
  284. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  285. # update pip req's.
  286. ureq "pip freeze > requirements.txt"
  287. # show last history scan
  288. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  289. # scan history
  290. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  291. # scan cron log for hs cmd
  292. crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
  293. # removes all but newest file
  294. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  295. snw "spotify-now -i '%artist - %title'"
  296. # }}} spotify-lib-vis #
  297. shc "shellcheck"
  298. pdl "pdflatex"
  299. tcl "tex-clean"
  300. # mfs
  301. mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
  302. ht "python3 -m http.server"
  303. # j "jekyll"
  304. # js "jekyll serve"
  305. h "hugo"
  306. he "hugo serve -D --disableFastRender"
  307. ss "ssh kevin@192.168.0.100"
  308. ssb "ssh-bandit"
  309. rt "python ~/coding/rt-scraper/rt-scraper.py"
  310. # }}} coding projs #
  311. # school {{{ #
  312. wlf "watson log --all --tag=final"
  313. wrf "watson report --all --tag=final"
  314. # 369 {{{ #
  315. ssc "ssh mokkar@teach.cs.utoronto.ca"
  316. ma "printf '\033c' && bear make"
  317. mc "bear make clean"
  318. mca "bear make clean && printf '\033c' && bear make"
  319. rmc "rm compile_commands.json"
  320. rms "rm swapfile.*"
  321. wl6 "watson log --all --project=369 --tag=a4"
  322. wr6 "watson report --all --project=369 --tag=a4"
  323. um6 "sudo umount /mnt/369-a4"
  324. # a2 {{{ #
  325. mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
  326. # mr "printf '\033c' && make && ./carsim stop 10 20"
  327. # mr "printf '\033c' && bear make && ./carsim light 1 20"
  328. # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
  329. # lk "valgrind --leak-check=yes ./carsim stop 10 20"
  330. lk "valgrind --leak-check=yes ./carsim light 1 1"
  331. # hl "valgrind --tool=helgrind ./carsim stop 10 20"
  332. hl "valgrind --tool=helgrind ./carsim light 10 20"
  333. # }}} a2 #
  334. # a1
  335. # sa "ssh k@192.168.0.17"
  336. # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
  337. # cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
  338. # }}} 369 #
  339. # 309{{{
  340. wl0 "watson log --all --project=309 --tag=phase2"
  341. wr0 "watson report --all --project=309 --tag=phase2"
  342. # apps
  343. nd "node"
  344. ndm "nodemon"
  345. knd "killall node"
  346. mg "mongo"
  347. # server
  348. 0ht "cd ~/school/309-proj && python3 -m http.server"
  349. mgd "mongod --dbpath mongo-data"
  350. # nds "killall node && nodemon server.js"
  351. nds "nodemon server.js"
  352. # heroku
  353. hr "heroku"
  354. hrs "heroku local web"
  355. hrt "heroku ps"
  356. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  357. gpsh "git push heroku"
  358. 0c "node collections.js"
  359. # }}}
  360. # }}} school #