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.

374 lines
8.2 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
  1. # system {{{ #
  2. # clear screen
  3. c "printf '\033c'"
  4. hst "history"
  5. nf "printf '\033c' && neofetch | lolcat"
  6. fi "fish"
  7. # reload urxvt
  8. ru "xrdb ~/.Xresources"
  9. # list file sizes in megabytes with depth 1
  10. dum "sudo du -d 1 -B M"
  11. tl "tldr"
  12. nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
  13. vgb "sni /etc/default/grub"
  14. mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  15. grep "grep --color=auto -n"
  16. rg "grep -r"
  17. # pk "pkill -f"
  18. cld "colordiff -y --suppress-common-lines"
  19. mkpk "makepkg -sri"
  20. mkex "chmod 777"
  21. # systemctl {{{ #
  22. ctl "sudo systemctl"
  23. ctle "sudo systemctl enable"
  24. ctld "sudo systemctl disable"
  25. ctla "sudo systemctl start"
  26. ctls "sudo systemctl stop"
  27. ctlt "sudo systemctl status"
  28. ctlr "sudo systemctl restart"
  29. # }}} systemctl #
  30. wm "sudo wifi-menu"
  31. # mounting
  32. udm "udisksctl mount -b"
  33. udmb "udisksctl mount -b /dev/sdc2"
  34. udu "udisksctl unmount -b"
  35. udub "udisksctl unmount -b /dev/sdc2"
  36. to "touch"
  37. # directory-related {{{ #
  38. l "ls -a"
  39. ll "ls -alFh"
  40. smv "sudo mv"
  41. f "cd"
  42. fz "fzf"
  43. fnd "find . -type f -name"
  44. rmr "rm -rf"
  45. md "mkdir -p"
  46. rsy "rsync -Pr"
  47. # list all (un)mounted drives
  48. lhd "sudo fdisk -l"
  49. # get disc space for mounted drives
  50. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  51. ds "df -h | head -n 1 && df -h | grep sd"
  52. chownw "sudo chown -R kevin:wheel"
  53. chwnm "sudo chown -R kevin:wheel /run/media/kevin"
  54. # cd into backup folder and show backup sizes
  55. nbu "f /run/media/kevin/pc-backup/backups/nzxt && ll | grep gz"
  56. # }}} directory-related #
  57. # power options {{{ #
  58. s "systemctl suspend"
  59. sd "sudo shutdown 0"
  60. reb "sudo shutdown -r 0"
  61. lo "i3-msg exit"
  62. x "xmodmap ~/.Xmodmap && xset r rate 200 70"
  63. X "xmodmap ~/.Xmodmap && xset r rate 200 70"
  64. # }}} power options #
  65. # sound
  66. vlm "alsamixer -c 0"
  67. vlh "alsamixer -c 2"
  68. # apt
  69. # apti "sudo apt install"
  70. # aptr "sudo apt remove"
  71. # aptu "sudo apt upgrade"
  72. # pacman {{{ #
  73. pc "sudo pacman -S"
  74. pcr "sudo pacman -Rs"
  75. pcud "sudo pacman -Sy"
  76. pcug "sudo pacman -Syu"
  77. pcv "sudo pacman -Q"
  78. xpc "pacman -Qqe > ~/linux-config/txt/nzxt-pkgs.txt"
  79. # tri "trizen -S --noconfirm"
  80. tri "trizen -S --noedit"
  81. # }}} pacman #
  82. py "python"
  83. pipi "sudo pip install"
  84. # internet
  85. pgo "ping -c 3 8.8.8.8"
  86. dh "sudo dhcpcd"
  87. kdh "sudo killall dhcpcd"
  88. rdh "sudo killall dhcpcd && sudo dhcpcd"
  89. id "identify"
  90. # }}} system #
  91. # config files {{{ #
  92. rf "source ~/.config/fish/config.fish"
  93. rz "source ~/linux-config/aliases/zsh_aliases"
  94. lca "f ~/linux-config/aliases"
  95. pipes "pipes.sh -t 3"
  96. # }}} config files #
  97. # applications {{{ #
  98. # silent="> /dev/null 2>&1& "
  99. chr "google-chrome"
  100. # h "htop -s PERCENT_MEM"
  101. hc "htop -s PERCENT_CPU"
  102. r "ranger"
  103. mra "man ranger"
  104. clc "cloc ."
  105. n "nvim"
  106. sn "sudo nvim"
  107. fh "feh"
  108. sx "sxiv"
  109. sxa "sxiv -a"
  110. wg "wego"
  111. wp "grep wallpaper ~/.cache/wal/colors.sh"
  112. kd "killall Discord && killall Discord"
  113. # rsl "java -jar ~/Downloads/RuneLite.jar"
  114. # swex "sudo nohup ~/Downloads/swex.appimage $silent"
  115. cv "cava"
  116. rx "redshift -x"
  117. gpe "gpg --encrypt --recipient"
  118. gpd "gpg --decrypt"
  119. # pass {{{ #
  120. ps "pass"
  121. psc "pass -c"
  122. pse "pass edit"
  123. psi "pass insert -m"
  124. psg "pass generate -c"
  125. xclip "xclip -selection clipboard"
  126. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  127. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  128. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  129. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  130. # }}} pass #
  131. p3 "python3"
  132. py "python"
  133. # watson {{{ #
  134. w "watson"
  135. wa "watson start"
  136. we "watson edit"
  137. wl "watson log --day"
  138. wlw "watson log"
  139. # wlm "watson log --project coding --tag mfs"
  140. wr "watson report"
  141. ws "watson stop"
  142. wse "watson stop && watson edit"
  143. wsl "watson stop && watson log --day"
  144. wt "watson status"
  145. # }}} watson #
  146. # }}} applications #
  147. # git {{{ #
  148. gstr "git config credential.helper store"
  149. g "git"
  150. # branch {{{ #
  151. gb "git branch"
  152. gba "git branch --no-merged && echo '' && git branch --merged"
  153. gbu "git branch --no-merged"
  154. gbm "git branch --merged"
  155. # }}} branch #
  156. gr "git remote"
  157. # add/remove {{{ #
  158. ga "git add -A . && git status -u"
  159. gac "git add -A . && git commit -S"
  160. # unsigned commt
  161. gacu "git add -A . && git commit"
  162. grm "git rm"
  163. grmf "git rm -f"
  164. grmc "git rm --cached"
  165. grmfc "git rm -f --cached"
  166. # }}} add #
  167. # diff/log {{{ #
  168. gd "git diff -w"
  169. gdc "git diff --cached"
  170. gds "git diff --stat"
  171. gdt "git difftool --tool=vimdiff"
  172. gl "git log"
  173. gsl "git shortlog"
  174. # }}} diff/log #
  175. # update {{{ #
  176. gs "git status -u"
  177. gchom "git checkout master"
  178. gchnw "git checkout -b wip"
  179. gchw "git checkout wip"
  180. gheadm1 "git reset --hard HEAD~1"
  181. # show files in git repo
  182. # gls "git ls-tree -r HEAD --name-only"
  183. gls "git ls-tree HEAD --name-only"
  184. # push {{{ #
  185. gst "git stash"
  186. gstl "git stash list"
  187. gstp "git stash pop"
  188. gc "git commit -S"
  189. gcu "git commit"
  190. gca "git add -A . && git commit --amend --no-edit -S"
  191. gcam "git add -A . && git commit --amend -S"
  192. # gcamp "git add -A . && git commit --amend --no-edit -S && gpsf"
  193. psgi "git add . && git commit -m 'Update' -S && git push"
  194. gps "git push"
  195. # gpsn "git push --set-upstream origin master"
  196. gpsn "eval (git push 2>&1 | tail -n 2)"
  197. gpsf "git push --force"
  198. gclear "git stash clear"
  199. gpl "git pull --rebase"
  200. grbc "git rebase --continue"
  201. # }}} push #
  202. # }}} update #
  203. crm "mrk README.md"
  204. gcho "git checkout"
  205. gchon "git checkout -b"
  206. gf "git fetch origin"
  207. gcln "git clone"
  208. gchp "git cherry-pick"
  209. gchpc "git cherry-pick --continue"
  210. # assume file unchanged
  211. gunc "git update-index --assume-unchanged"
  212. # }}} git #
  213. # coding projs {{{ #
  214. # coding_dir="~/coding"
  215. # trapbot {{{ #
  216. # tb "$cd_coding_dir/trapbot"
  217. # vtb "$cd_coding_dir/trapbot && ni scan_reddit.py"
  218. # ptb "python scan_reddit.py"
  219. # rtb "$cd_coding_dir/trapbot && python scan_reddit.py"
  220. # }}} trapbot #
  221. # spotify-lib-vis {{{ #
  222. # spv_dir="$coding_dir""/spotify-lib-vis"
  223. # svl "f $spv_dir/src/login"
  224. # sva "f $spv_dir/src/api"
  225. # svg "f $spv_dir/src/graphs"
  226. # svscs "f $spv_dir/src/static/scss"
  227. # svcss "f $spv_dir/src/spotifyvis/static/scss"
  228. # start spv server from dir
  229. pg "sudo systemctl start postgresql.service && systemctl status postgresql.service"
  230. ssv "bash ../bin/activate && python manage.py runserver"
  231. # start spv server outside dir
  232. sssv "sv && ssv"
  233. # open spv db in psql
  234. spvdb "psql -d spotifyvis -U django"
  235. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  236. cldb "python manage.py flush --no-input && ssv"
  237. # django shell
  238. djs "python manage.py shell"
  239. # update pip
  240. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  241. # update pip req's.
  242. ureq "pip freeze > requirements.txt"
  243. # show last history scan
  244. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  245. # scan history
  246. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  247. # scan cron log for hs cmd
  248. crnl "grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
  249. # removes all but newest file
  250. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  251. snw "spotify-now -i '%artist - %title'"
  252. # }}} spotify-lib-vis #
  253. shc "shellcheck"
  254. pdl "pdflatex"
  255. tcl "tex-clean"
  256. # mfs
  257. mfs "nvim /home/kevin/coding/best-mf-site-personal/index.html"
  258. ht "python3 -m http.server"
  259. # j "jekyll"
  260. # js "jekyll serve"
  261. h "hugo"
  262. he "hugo serve -D --disableFastRender"
  263. ss "ssh kevin@192.168.0.100"
  264. ssb "ssh-bandit"
  265. # }}} coding projs #
  266. # school {{{ #
  267. # 369 {{{ #
  268. # a2
  269. m "printf '\033c' && bear make"
  270. mc "bear make clean"
  271. mcr "bear make clean && printf '\033c' && bear make && ./carsim light 1 20"
  272. # mr "printf '\033c' && make && ./carsim stop 10 20"
  273. mr "printf '\033c' && bear make && ./carsim light 1 20"
  274. # "valgrind --tool=helgrind ./carsim stop 10 50 > helgrind.txt 2>&1 && valgrind --tool=helgrind ./carsim light 10 50 >> helgrind.txt 2>&1"
  275. # lk "valgrind --leak-check=yes ./carsim stop 10 20"
  276. lk "valgrind --leak-check=yes ./carsim light 1 1"
  277. # hl "valgrind --tool=helgrind ./carsim stop 10 20"
  278. hl "valgrind --tool=helgrind ./carsim light 10 20"
  279. # a1
  280. # sa "ssh k@192.168.0.17"
  281. # cpi "scp interceptor.c kevin@192.168.0.17:/home/kevin/a1"
  282. # cpti "gcc -m32 -o test_intercept test_intercept.c && scp test_intercept k@192.168.0.17:/home/k/a1"
  283. # }}} 369 #
  284. # 309
  285. 0ht "cd ~/school/309-proj && python3 -m http.server"
  286. # }}} school #