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.

464 lines
10 KiB

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