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.

445 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
  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. rmsw "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. pipes "pipes.sh -t 3"
  133. py "python"
  134. r "ranger"
  135. rx "redshift -x"
  136. sn "sudo nvim"
  137. sx "sxiv"
  138. sxa "sxiv -a"
  139. sxt "sxiv -t *"
  140. vmd "vimdiff"
  141. wg "wego"
  142. wp "grep wallpaper ~/.cache/wal/colors.sh"
  143. z "zathura --fork"
  144. lz "unzip -l"
  145. # rsl "java -jar ~/Downloads/RuneLite.jar"
  146. # swex "sudo nohup ~/Downloads/swex.appimage $silent"
  147. # pass {{{ #
  148. ps "pass"
  149. psc "pass -c"
  150. pse "pass edit"
  151. psi "pass insert -m"
  152. psg "pass generate -c"
  153. xc "xclip -selection clipboard"
  154. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  155. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  156. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  157. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  158. # }}} pass #
  159. # watson {{{ #
  160. w "watson"
  161. wa "watson start"
  162. wae "watson start && watson edit"
  163. we "watson edit"
  164. wl "watson log --day"
  165. wla "watson log --all --tag="
  166. ww "watson log"
  167. # wlm "watson log --project coding --tag mfs"
  168. wr "watson report --day"
  169. wrw "watson report"
  170. wre "watson restart"
  171. ws "watson status && watson stop"
  172. wse "watson stop && watson edit"
  173. wsc "watson cancel"
  174. wsl "watson stop && watson log --day"
  175. wt "watson status"
  176. # }}} watson #
  177. # }}} applications #
  178. # git {{{ #
  179. gstr "git config credential.helper store"
  180. g "git"
  181. # branch {{{ #
  182. gb "git branch"
  183. gbd "git branch -D"
  184. gba "git branch --no-merged && echo '' && git branch --merged"
  185. gbu "git branch --no-merged"
  186. gbm "git branch --merged"
  187. gmg "git merge"
  188. gmgt "git mergetool"
  189. # }}} branch #
  190. gr "git remote -v"
  191. gro "git remote show origin"
  192. # add/remove {{{ #
  193. ga "git add -A && git status -u"
  194. gac "git add -A && git commit -S"
  195. gaf "git add -f"
  196. # unsigned commt
  197. gacu "git add -A && git commit"
  198. grm "git rm"
  199. grmf "git rm -f"
  200. grmc "git rm --cached"
  201. grmfc "git rm -f --cached"
  202. # }}} add #
  203. # diff/log {{{ #
  204. gd "git difftool -w --tool=vimdiff"
  205. gdc "git difftool -w --cached --tool=vimdiff"
  206. gdl "git diff -w"
  207. gdlc "git diff --cached -w"
  208. gdh "git diff --cached -w HEAD~1"
  209. gds "git diff --stat"
  210. gl "git log"
  211. gsl "git shortlog"
  212. # }}} diff/log #
  213. # update {{{ #
  214. gs "git status -u"
  215. gchom "git checkout master"
  216. gchnw "git checkout -b wip"
  217. gchw "git checkout wip"
  218. gheadm1 "git reset --hard HEAD~1"
  219. # show files in git repo
  220. # gls "git ls-tree -r HEAD --name-only"
  221. gls "git ls-tree HEAD --name-only"
  222. # push {{{ #
  223. gst "git stash"
  224. gstl "git stash list"
  225. gstp "git stash pop"
  226. gc "git commit -S"
  227. gcu "git commit"
  228. gca "git add -A && git commit --amend --no-edit -S"
  229. gcam "git add -A && git commit --amend -S"
  230. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  231. psgi "git add -A && git commit -m 'Update' -S && git push"
  232. gps "git push"
  233. gpsi "git config credential.helper store && git push"
  234. # gpsn "git push --set-upstream origin master"
  235. gpsn "eval (git push 2>&1 | tail -n 2)"
  236. gpsf "git push --force"
  237. gclear "git stash clear"
  238. gpl "git pull --rebase"
  239. grba "git rebase --abort"
  240. grbc "git rebase --continue"
  241. # }}} push #
  242. # }}} update #
  243. crm "mrk README.md"
  244. gcho "git checkout"
  245. gchon "git checkout -b"
  246. gf "git fetch origin"
  247. gcln "git clone"
  248. gchp "git cherry-pick"
  249. gchpc "git cherry-pick --continue"
  250. # assume file unchanged
  251. gunc "git update-index --assume-unchanged"
  252. # }}} git #
  253. # coding projs {{{ #
  254. # coding_dir="~/coding"
  255. rgt "rg TODO"
  256. # trapbot {{{ #
  257. # tb "$cd_coding_dir/trapbot"
  258. # vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
  259. # ptb "python scan_reddit.py"
  260. # rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
  261. # }}} trapbot #
  262. # spotify-lib-vis {{{ #
  263. # spv_dir="$coding_dir""/spotify-lib-vis"
  264. # svl "f $spv_dir/src/login"
  265. # sva "f $spv_dir/src/api"
  266. # svg "f $spv_dir/src/graphs"
  267. # svscs "f $spv_dir/src/static/scss"
  268. # svcss "f $spv_dir/src/spotifyvis/static/scss"
  269. # start spv server from dir
  270. # pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
  271. ssv "bash ../bin/activate && python manage.py runserver"
  272. # start spv server outside dir
  273. # open spv db in psql
  274. spvdb "psql -d spotifyvis -U django"
  275. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  276. cldb "python manage.py flush --no-input && ssv"
  277. # django shell
  278. djs "python manage.py shell"
  279. # update pip
  280. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  281. # update pip req's.
  282. ureq "pip freeze > requirements.txt"
  283. # show last history scan
  284. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  285. # scan history
  286. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  287. # scan cron log for hs cmd
  288. crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
  289. # removes all but newest file
  290. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  291. snw "spotify-now -i '%artist - %title'"
  292. # }}} spotify-lib-vis #
  293. shc "shellcheck"
  294. pdl "pdflatex"
  295. tcl "tex-clean"
  296. # mfs
  297. mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
  298. ht "python3 -m http.server"
  299. # j "jekyll"
  300. # js "jekyll serve"
  301. h "hugo"
  302. he "hugo serve -D --disableFastRender"
  303. ss "ssh kevin@192.168.0.100"
  304. ssb "ssh-bandit"
  305. rt "python ~/coding/rt-scraper/rt-scraper.py"
  306. # }}} coding projs #
  307. # school {{{ #
  308. # 369 {{{ #
  309. ssc "ssh mokkar@teach.cs.utoronto.ca"
  310. ma "printf '\033c' && bear make"
  311. mc "bear make clean"
  312. mca "bear make clean && printf '\033c' && bear make"
  313. rmc "rm compile_commands.json"
  314. rms "rm swapfile.*"
  315. wl6 "watson log --all --project=369 --tag=a4"
  316. wr6 "watson report --all --project=369 --tag=a4"
  317. um6 "sudo umount /mnt/369-a4"
  318. # a2 {{{ #
  319. mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
  320. # mr "printf '\033c' && make && ./carsim stop 10 20"
  321. # mr "printf '\033c' && bear make && ./carsim light 1 20"
  322. # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
  323. # lk "valgrind --leak-check=yes ./carsim stop 10 20"
  324. lk "valgrind --leak-check=yes ./carsim light 1 1"
  325. # hl "valgrind --tool=helgrind ./carsim stop 10 20"
  326. hl "valgrind --tool=helgrind ./carsim light 10 20"
  327. # }}} a2 #
  328. # a1
  329. # sa "ssh k@192.168.0.17"
  330. # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
  331. # cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
  332. # }}} 369 #
  333. # 309
  334. # wl0 "watson log --all --project=309 --tag=e3"
  335. # wr0 "watson report --all --project=309 --tag=e3"
  336. nd "node"
  337. ndm "nodemon"
  338. knd "killall node"
  339. mg "mongo"
  340. 0ht "cd ~/school/309-proj && python3 -m http.server"
  341. mgd "mongod --dbpath mongo-data"
  342. nds "killall node && nodemon server.js"
  343. hr "heroku"
  344. hrt "heroku ps"
  345. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  346. wlh "watson log --all --project=hps --tag=essay"
  347. wrh "watson report --all --project=hps --tag=essay"
  348. # }}} school #