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.

391 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
  1. # vim: fdm=indent
  2. # system
  3. # clear screen
  4. c "printf '\033c'"
  5. hst "history"
  6. ## nf "printf '\033c' && neofetch | lolcat"
  7. nf "printf '\033c' && neofetch"
  8. fi "fish"
  9. # reload urxvt
  10. ru "xrdb ~/.Xresources"
  11. # list file sizes in megabytes with depth 1
  12. duh "sudo du -d 1 -h --apparent-size | sort -hr"
  13. dum "sudo du -d 1 -m --apparent-size | sort -hr"
  14. m "man"
  15. tl "tldr"
  16. nvt "nvidia-settings --assign CurrentMetaMode='DVI-I-1: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +3840+0 {ForceCompositionPipeline=On}'"
  17. vgb "sudo nvim /etc/default/grub"
  18. mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  19. b "bat"
  20. ba "bat *"
  21. grep "grep --color=auto -n"
  22. grr "grep -r"
  23. # pk "pkill -f"
  24. cld "colordiff -wy --suppress-common-lines"
  25. mkpk "makepkg -sri"
  26. ex "chmod 777"
  27. ex "chmod 777"
  28. # systemctl #
  29. ctl "sudo systemctl"
  30. ctle "sudo systemctl enable"
  31. ctld "sudo systemctl disable"
  32. ctla "sudo systemctl start"
  33. ctls "sudo systemctl stop"
  34. ctlt "sudo systemctl status"
  35. ctltd "sudo systemctl status dhcpcd"
  36. ctlr "sudo systemctl restart"
  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. vd "vidir --verbose"
  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 {{ .chezmoi.group }}:wheel"
  64. chwnm "sudo chown -R {{ .chezmoi.group }}:wheel /run/media/{{ .chezmoi.username }}"
  65. # cd into backup folder and show backup sizes
  66. nbu "cd /run/media/{{ .chezmoi.group }}/backup-hd/{{ .chezmoi.fullHostname }}/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. # sound
  77. vlm "alsamixer -c 0"
  78. vlh "alsamixer -c 2"
  79. # apt
  80. # apti "sudo apt install"
  81. # aptr "sudo apt remove"
  82. # aptu "sudo apt upgrade"
  83. # pacman #
  84. # pc "sudo pacman -S"
  85. # pcq "sudo pacman -Qi"
  86. # pcr "sudo pacman -Rns"
  87. # pcud "sudo pacman -Sy"
  88. # pcug "sudo pacman -Syu"
  89. # xpc "pacman -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && pacman -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  90. # tri "trizen -S --noconfirm"
  91. tri "trizen -S --noedit"
  92. # install
  93. ya "yay -S --answerclean=None --answerdiff=None --answeredit=None"
  94. # info
  95. yaq "yay -Qi"
  96. # remove
  97. yar "yay -Rns"
  98. # sync
  99. yaud "yay -Sy"
  100. # sync and download
  101. yaugd "yay -Syuw --answerclean=None --answerdiff=None --answeredit=None"
  102. # sync and update
  103. yaug "yay -Syu --answerclean=None --answerdiff=None --answeredit=None"
  104. # export packages
  105. xya "yay -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && yay -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  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 ~/{{ .chezmoi.os }}-config/aliases/zsh_aliases"
  115. # system
  116. chr "google-chrome"
  117. # applications #
  118. # silent="> /dev/null 2>&1& "
  119. clc "cloc ."
  120. cv "cava"
  121. dg "dragon-drag-and-drop -x"
  122. fh "feh"
  123. gpd "gpg --decrypt"
  124. gpe "gpg --encrypt --recipient"
  125. htc "htop -s PERCENT_CPU"
  126. htm "htop -s PERCENT_MEM"
  127. i "sxiv"
  128. ig "sxiv -a"
  129. it "sxiv -t *"
  130. ka "killall"
  131. kd "killall Discord && killall Discord && killall slack"
  132. kt "killall thunderbird"
  133. mp "mpv --volume=50"
  134. mra "man ranger"
  135. n "nvim"
  136. p3 "python3"
  137. pdft "pdftotext"
  138. pipes "pipes.sh -t 3"
  139. py "python"
  140. r "ranger"
  141. rx "redshift -x"
  142. sn "sudo nvim"
  143. vmd "vimdiff"
  144. wg "wego"
  145. wp "grep wallpaper ~/.cache/wal/colors.sh"
  146. z "zathura --fork"
  147. lz "unzip -l"
  148. # rsl "java -jar ~/Downloads/RuneLite.jar"
  149. # swex "sudo nohup ~/Downloads/swex.appimage $silent"
  150. # pass #
  151. ps "pass"
  152. psc "pass -c"
  153. pse "pass edit"
  154. psi "pass insert -m"
  155. psg "pass generate -c"
  156. pss "pass show"
  157. xc "xclip -selection clipboard"
  158. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  159. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  160. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  161. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  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. wra "watson report --all"
  172. wrw "watson report"
  173. wre "watson restart"
  174. wree "watson restart && watson edit"
  175. ws "watson status && watson stop"
  176. wse "watson stop && watson edit"
  177. wsc "watson cancel"
  178. wsl "watson stop && watson log --day"
  179. wt "watson status"
  180. # applications #
  181. g "git"
  182. # git #
  183. gstr "git config credential.helper store"
  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. gr "git remote -v"
  193. gro "git remote show origin"
  194. # add/remove #
  195. ga "git add -A && git status -u"
  196. gac "git add -A && git commit -S"
  197. gaf "git add -f"
  198. # unsigned commt
  199. gacu "git add -A && git commit"
  200. grm "git rm"
  201. grmf "git rm -f"
  202. grmc "git rm --cached"
  203. grmfc "git rm -f --cached"
  204. grmor "rm (fd -e orig --no-ignore -H)"
  205. # add #
  206. gd "git difftool -w --tool=vimdiff"
  207. # diff/log #
  208. gdc "git difftool -w --cached --tool=vimdiff"
  209. gdl "git diff -w"
  210. gdlc "git diff --cached -w"
  211. gdh "git diff --cached -w HEAD~1"
  212. gds "git diff --stat"
  213. gl "git log"
  214. gsl "git shortlog"
  215. # diff/log #
  216. gs "git status -u"
  217. # update #
  218. gchom "git checkout master"
  219. gchnw "git checkout -b wip"
  220. gchw "git checkout wip"
  221. gheadm1 "git reset --hard HEAD~1"
  222. # show files in git repo
  223. # gls "git ls-tree -r HEAD --name-only"
  224. gls "git ls-tree HEAD --name-only"
  225. # push #
  226. gst "git stash"
  227. gstl "git stash list"
  228. gstp "git stash pop"
  229. gc "git commit -S"
  230. gcu "git commit"
  231. gca "git add -A && git commit --amend --no-edit -S"
  232. gcam "git add -A && git commit --amend -S"
  233. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  234. psgi "git add -A && git commit -m 'Update' -S && git push"
  235. gps "git push"
  236. gpsi "git config credential.helper store && git push"
  237. # gpsn "git push --set-upstream origin master"
  238. gpsn "eval (git push 2>&1 | tail -n 2)"
  239. gpsf "git push --force"
  240. gclear "git stash clear"
  241. gpl "git pull --rebase"
  242. grba "git rebase --abort"
  243. grbc "git rebase --continue"
  244. crm "mrk README.md"
  245. gcho "git checkout"
  246. gchon "git checkout -b"
  247. gf "git fetch origin"
  248. gcln "git clone"
  249. gchp "git cherry-pick"
  250. gchpc "git cherry-pick --continue"
  251. # assume file unchanged
  252. gunc "git update-index --assume-unchanged"
  253. # git #
  254. rgt "rg TODO"
  255. # coding projs #
  256. ## chezmoi
  257. zm "chezmoi"
  258. za "chezmoi add"
  259. zar "chezmoi add -r"
  260. zd "chezmoi data"
  261. ze "chezmoi edit"
  262. zp "chezmoi -v apply"
  263. ssv "source ../bin/activate.fish && python manage.py runserver"
  264. # spotify-lib-vis #
  265. # start spv server outside dir
  266. # open spv db in psql
  267. spvdb "psql -d spotifyvis -U django"
  268. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  269. cldb "python manage.py flush --no-input && ssv"
  270. # django shell
  271. djs "python manage.py shell"
  272. # update pip
  273. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  274. # update pip req's.
  275. ureq "pip freeze > requirements.txt"
  276. # show last history scan
  277. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  278. # scan history
  279. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  280. # scan cron log for hs cmd
  281. crnl "grep \"({{ .chezmoi.group }}) CMD\" /var/log/syslog | tail -n 1 && hlg"
  282. # removes all but newest file
  283. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  284. snw "spotify-now -i '%artist - %title'"
  285. shc "shellcheck"
  286. pdl "pdflatex"
  287. tcl "tex-clean"
  288. # mfs
  289. mfs "nvim {{ .chezmoi.homedir }}/coding/best-mf-site-personal/index.html"
  290. ht "python3 -m http.server"
  291. # j "jekyll"
  292. # js "jekyll serve"
  293. h "hugo"
  294. he "hugo serve -D --disableFastRender"
  295. ss "ssh {{ .chezmoi.group }}@192.168.0.100"
  296. ssb "ssh-bandit"
  297. rt "python ~/coding/rt-scraper/!rt-scraper.py"
  298. med "printf '\033c' && bear make move_mouse_with_head && ./move_mouse_with_head"
  299. # coding projs #
  300. wlf "watson log --all --tag=final"
  301. wrf "watson report --all --tag=final"
  302. # school #
  303. # 369 #
  304. ssc "ssh mokkar@teach.cs.utoronto.ca"
  305. ma "printf '\033c' && bear make"
  306. mc "bear make clean"
  307. mca "bear make clean && printf '\033c' && bear make"
  308. rmc "rm compile_commands.json"
  309. rms "rm swapfile.*"
  310. wl0 "watson log --all --project=309 --tag=phase2"
  311. wr0 "watson report --all --project=309 --tag=phase2"
  312. # 309
  313. # apps
  314. nd "node"
  315. ndm "nodemon"
  316. knd "killall node"
  317. mg "mongo"
  318. # server
  319. 0ht "cd ~/school/309-proj && python3 -m http.server"
  320. mgd "mongod --dbpath mongo-data"
  321. # nds "killall node && nodemon server.js"
  322. nds "nodemon server.js"
  323. # heroku
  324. hr "heroku"
  325. hrs "heroku local web"
  326. hrt "heroku ps"
  327. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  328. gpsh "git push heroku"
  329. 0c "node collections.js"
  330. # school #