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.

466 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. zt "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. zm "chezmoi"
  260. za "chezmoi add"
  261. zar "chezmoi add -r"
  262. ze "chezmoi edit"
  263. zp "chezmoi -v apply"
  264. rgt "rg TODO"
  265. # trapbot {{{ #
  266. # tb "$cd_coding_dir/trapbot"
  267. # vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
  268. # ptb "python scan_reddit.py"
  269. # rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
  270. # }}} trapbot #
  271. # spotify-lib-vis {{{ #
  272. # spv_dir="$coding_dir""/spotify-lib-vis"
  273. # svl "f $spv_dir/src/login"
  274. # sva "f $spv_dir/src/api"
  275. # svg "f $spv_dir/src/graphs"
  276. # svscs "f $spv_dir/src/static/scss"
  277. # svcss "f $spv_dir/src/spotifyvis/static/scss"
  278. # start spv server from dir
  279. # pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
  280. ssv "bash ../bin/activate && python manage.py runserver"
  281. # start spv server outside dir
  282. # open spv db in psql
  283. spvdb "psql -d spotifyvis -U django"
  284. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  285. cldb "python manage.py flush --no-input && ssv"
  286. # django shell
  287. djs "python manage.py shell"
  288. # update pip
  289. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  290. # update pip req's.
  291. ureq "pip freeze > requirements.txt"
  292. # show last history scan
  293. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  294. # scan history
  295. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  296. # scan cron log for hs cmd
  297. crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
  298. # removes all but newest file
  299. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  300. snw "spotify-now -i '%artist - %title'"
  301. # }}} spotify-lib-vis #
  302. shc "shellcheck"
  303. pdl "pdflatex"
  304. tcl "tex-clean"
  305. # mfs
  306. mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
  307. ht "python3 -m http.server"
  308. # j "jekyll"
  309. # js "jekyll serve"
  310. h "hugo"
  311. he "hugo serve -D --disableFastRender"
  312. ss "ssh kevin@192.168.0.100"
  313. ssb "ssh-bandit"
  314. rt "python ~/coding/rt-scraper/rt-scraper.py"
  315. # }}} coding projs #
  316. # school {{{ #
  317. wlf "watson log --all --tag=final"
  318. wrf "watson report --all --tag=final"
  319. # 369 {{{ #
  320. ssc "ssh mokkar@teach.cs.utoronto.ca"
  321. ma "printf '\033c' && bear make"
  322. mc "bear make clean"
  323. mca "bear make clean && printf '\033c' && bear make"
  324. rmc "rm compile_commands.json"
  325. rms "rm swapfile.*"
  326. wl6 "watson log --all --project=369 --tag=a4"
  327. wr6 "watson report --all --project=369 --tag=a4"
  328. um6 "sudo umount /mnt/369-a4"
  329. # a2 {{{ #
  330. mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
  331. # mr "printf '\033c' && make && ./carsim stop 10 20"
  332. # mr "printf '\033c' && bear make && ./carsim light 1 20"
  333. # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
  334. # lk "valgrind --leak-check=yes ./carsim stop 10 20"
  335. lk "valgrind --leak-check=yes ./carsim light 1 1"
  336. # hl "valgrind --tool=helgrind ./carsim stop 10 20"
  337. hl "valgrind --tool=helgrind ./carsim light 10 20"
  338. # }}} a2 #
  339. # a1
  340. # sa "ssh k@192.168.0.17"
  341. # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
  342. # cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
  343. # }}} 369 #
  344. # 309{{{
  345. wl0 "watson log --all --project=309 --tag=phase2"
  346. wr0 "watson report --all --project=309 --tag=phase2"
  347. # apps
  348. nd "node"
  349. ndm "nodemon"
  350. knd "killall node"
  351. mg "mongo"
  352. # server
  353. 0ht "cd ~/school/309-proj && python3 -m http.server"
  354. mgd "mongod --dbpath mongo-data"
  355. # nds "killall node && nodemon server.js"
  356. nds "nodemon server.js"
  357. # heroku
  358. hr "heroku"
  359. hrs "heroku local web"
  360. hrt "heroku ps"
  361. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  362. gpsh "git push heroku"
  363. 0c "node collections.js"
  364. # }}}
  365. # }}} school #