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.

459 lines
9.9 KiB

  1. # vim: fdm=marker ft=go-template.sh syntax=sh
  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. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  18. xr "xrandr"
  19. xrs "xrandr -s 0"
  20. xrr "xrandr --output HDMI2 --auto --right-of eDP1 --scale 1.33x1.33"
  21. xrm "xrandr --output HDMI2 --auto --same-as eDP1 --scale 1.33x1.33"
  22. {{ end }}
  23. vgb "sudo nvim /etc/default/grub"
  24. mkgb "sudo grub-mkconfig -o /boot/grub/grub.cfg"
  25. b "bat"
  26. ba "bat *"
  27. grep "grep --color=auto -n"
  28. grr "grep -r"
  29. # pk "pkill -f"
  30. cld "colordiff -wy --suppress-common-lines"
  31. mkpk "makepkg -sri"
  32. ex "chmod 777"
  33. ex "chmod 777"
  34. # systemctl [[[ #
  35. ctl "sudo systemctl"
  36. ctle "sudo systemctl enable"
  37. ctld "sudo systemctl disable"
  38. ctla "sudo systemctl start"
  39. ctls "sudo systemctl stop"
  40. ctlt "sudo systemctl status"
  41. ctltd "sudo systemctl status dhcpcd"
  42. ctlr "sudo systemctl restart"
  43. # ]]] systemctl #
  44. wm "sudo wifi-menu"
  45. # mounting [[[ #
  46. udm "udisksctl mount -b"
  47. udmb "udisksctl mount -b /dev/sdc2"
  48. udu "udisksctl unmount -b"
  49. udub "udisksctl unmount -b /dev/sdc2"
  50. # ]]] mounting #
  51. tc "touch"
  52. vd "vidir --verbose"
  53. # directory-related [[[ #
  54. ls "lsd"
  55. l "lsd -a"
  56. ll "lsd -al"
  57. smv "sudo mv"
  58. f "cd"
  59. fz "fzf"
  60. fnd "find . -type f -name"
  61. rmr "rm -rf"
  62. rmd "rm ~/Downloads/*"
  63. rmw "rm ~/.local/share/nvim/swap/"
  64. md "mkdir -p"
  65. rsy "rsync -Pr"
  66. # list all (un)mounted drives
  67. lhd "sudo fdisk -l"
  68. # get disc space for mounted drives
  69. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  70. ds "df -h | head -n 1 && df -h | grep sd"
  71. chownw "sudo chown -R {{ .chezmoi.group }}:wheel"
  72. chwnm "sudo chown -R {{ .chezmoi.group }}:wheel /run/media/{{ .chezmoi.username }}"
  73. # cd into backup folder and show backup sizes
  74. nbu "cd /run/media/{{ .chezmoi.group }}/backup-hd/{{ .chezmoi.fullHostname }}/tar && lsd -l"
  75. # ]]] directory-related #
  76. # power options [[[ #
  77. s "systemctl suspend"
  78. so "xset dpms force off"
  79. sd "systemctl poweroff"
  80. rb "systemctl reboot"
  81. lo "i3-msg exit"
  82. x "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  83. X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  84. # ]]] power options #
  85. # sound
  86. {{ if eq .chezmoi.fullHostname "nzxt" }}
  87. vlm "alsamixer -c 0"
  88. vlh "alsamixer -c 2"
  89. {{ else }}
  90. vlm "alsamixer -c 1"
  91. {{ end }}
  92. # apt [[[ #
  93. # apti "sudo apt install"
  94. # aptr "sudo apt remove"
  95. # aptu "sudo apt upgrade"
  96. # ]]] apt #
  97. # pacman [[[ #
  98. # pc "sudo pacman -S"
  99. # pcq "sudo pacman -Qi"
  100. # pcr "sudo pacman -Rns"
  101. # pcud "sudo pacman -Sy"
  102. # pcug "sudo pacman -Syu"
  103. # xpc "pacman -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && pacman -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  104. # ]]] pacman #
  105. # tri "trizen -S --noconfirm"
  106. tri "trizen -S --noedit"
  107. # yay [[[ #
  108. # install
  109. ya "yay -S --answerclean=None --answerdiff=None --answeredit=None"
  110. # info
  111. yaq "yay -Qi"
  112. # remove
  113. yar "yay -Rns"
  114. # sync
  115. yaud "yay -Sy"
  116. # sync and download
  117. yaugd "yay -Syuw --answerclean=None --answerdiff=None --answeredit=None"
  118. # sync and update
  119. yaug "yay -Syu --answerclean=None --answerdiff=None --answeredit=None"
  120. # export packages
  121. xya "yay -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && yay -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  122. # ]]] yay #
  123. py "python"
  124. pipi "sudo pip install"
  125. # internet
  126. pg "ping -c 3 -W 1 8.8.8.8"
  127. dh "sudo dhcpcd"
  128. kdh "sudo killall dhcpcd"
  129. rdh "sudo killall dhcpcd && sudo dhcpcd"
  130. id "identify"
  131. # rz "source ~/{{ .chezmoi.os }}-config/aliases/zsh_aliases"
  132. # system ]]]
  133. # applications [[[ #
  134. # silent="> /dev/null 2>&1& "
  135. chr "google-chrome"
  136. clc "cloc ."
  137. cv "cava"
  138. dg "dragon-drag-and-drop -x"
  139. fh "feh"
  140. gpd "gpg --decrypt"
  141. gpe "gpg --encrypt --recipient"
  142. htc "htop -s PERCENT_CPU"
  143. htm "htop -s PERCENT_MEM"
  144. i "sxiv"
  145. ig "sxiv -a"
  146. it "sxiv -t *"
  147. ka "killall"
  148. kd "killall Discord && killall Discord && killall slack"
  149. kt "killall thunderbird"
  150. mp "mpv --volume=50"
  151. mra "man ranger"
  152. n "nvim"
  153. p3 "python3"
  154. pdft "pdftotext"
  155. pipes "pipes.sh -t 3"
  156. py "python"
  157. r "ranger"
  158. rx "redshift -x"
  159. sn "sudo nvim"
  160. vmd "vimdiff"
  161. wg "wego"
  162. wp "grep wallpaper ~/.cache/wal/colors.sh"
  163. z "zathura --fork"
  164. lz "unzip -l"
  165. # pass [[[ #
  166. ps "pass"
  167. psc "pass -c"
  168. pse "pass edit"
  169. psi "pass insert -m"
  170. psg "pass generate -c"
  171. pss "pass show"
  172. xc "xclip -selection clipboard"
  173. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  174. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  175. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  176. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  177. # ]]] pass #
  178. # watson [[[ #
  179. w "watson"
  180. wa "watson start"
  181. wae "watson start && watson edit"
  182. we "watson edit"
  183. wl "watson log --day"
  184. wla "watson log --all --tag="
  185. ww "watson log"
  186. # wlm "watson log --project coding --tag mfs"
  187. wr "watson report --day"
  188. wra "watson report --all"
  189. wrw "watson report"
  190. wre "watson restart"
  191. wree "watson restart && watson edit"
  192. ws "watson status && watson stop"
  193. wse "watson stop && watson edit"
  194. wsc "watson cancel"
  195. wsl "watson stop && watson log --day"
  196. wt "watson status"
  197. # ]]] watson #
  198. # ]]] applications #
  199. # git [[[ #
  200. g "git"
  201. gstr "git config credential.helper store"
  202. # branch [[[ #
  203. gb "git branch"
  204. gbd "git branch -D"
  205. gba "git branch --no-merged && echo '' && git branch --merged"
  206. gbu "git branch --no-merged"
  207. gbm "git branch --merged"
  208. gmg "git merge"
  209. gmgt "git mergetool"
  210. gr "git remote -v"
  211. gro "git remote show origin"
  212. # ]]] branch #
  213. # add/remove [[[ #
  214. ga "git add -A && git status -u"
  215. gac "git add -A && git commit -S"
  216. gaf "git add -f"
  217. # unsigned commt
  218. gacu "git add -A && git commit"
  219. grm "git rm"
  220. grmf "git rm -f"
  221. grmc "git rm --cached"
  222. grmfc "git rm -f --cached"
  223. grmor "rm (fd -e orig --no-ignore -H)"
  224. # ]]] add/remove #
  225. # diff/log [[[ #
  226. gd "git difftool -w --tool=vimdiff"
  227. gdc "git difftool -w --cached --tool=vimdiff"
  228. gdl "git diff -w"
  229. gdlc "git diff --cached -w"
  230. gdh "git diff --cached -w HEAD~1"
  231. gds "git diff --stat"
  232. gl "git log"
  233. gsl "git shortlog"
  234. # ]]] diff/log #
  235. # pull [[[ #
  236. gcln "git clone"
  237. gs "git status -u"
  238. gf "git fetch origin"
  239. gcho "git checkout"
  240. gchon "git checkout -b"
  241. gchom "git checkout master"
  242. gchnw "git checkout -b wip"
  243. gchw "git checkout wip"
  244. gheadm1 "git reset --hard HEAD~1"
  245. # show files in git repo
  246. # gls "git ls-tree -r HEAD --name-only"
  247. gls "git ls-tree HEAD --name-only"
  248. gchp "git cherry-pick"
  249. gchpc "git cherry-pick --continue"
  250. gst "git stash"
  251. gstl "git stash list"
  252. gstp "git stash pop"
  253. gpl "git pull --rebase"
  254. grba "git rebase --abort"
  255. grbc "git rebase --continue"
  256. # ]]] pull #
  257. # push [[[ #
  258. gc "git commit -S"
  259. gcu "git commit"
  260. gca "git add -A && git commit --amend --no-edit -S"
  261. gcam "git add -A && git commit --amend -S"
  262. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  263. psgi "git add -A && git commit -m 'Update' -S && git push"
  264. gps "git push"
  265. gpsi "git config credential.helper store && git push"
  266. # gpsn "git push --set-upstream origin master"
  267. gpsn "eval (git push 2>&1 | tail -n 2)"
  268. gpsf "git push --force"
  269. gclear "git stash clear"
  270. # assume file unchanged
  271. gunc "git update-index --assume-unchanged"
  272. # ]]] push #
  273. # ]]] git #
  274. # coding projs [[[ #
  275. rgt "rg TODO"
  276. # chezmoi [[[ #
  277. zm "chezmoi"
  278. za "chezmoi add"
  279. zar "chezmoi add -r"
  280. zd "chezmoi data"
  281. zp "chezmoi -v apply"
  282. # ]]] chezmoi #
  283. # spotify-lib-vis [[[ #
  284. # start spv server outside dir
  285. ssv "source ../bin/activate.fish && python manage.py runserver"
  286. # open spv db in psql
  287. spvdb "psql -d spotifyvis -U django"
  288. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  289. cldb "python manage.py flush --no-input && ssv"
  290. # django shell
  291. djs "python manage.py shell"
  292. # update pip
  293. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  294. # update pip req's.
  295. ureq "pip freeze > requirements.txt"
  296. # show last history scan
  297. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  298. # scan history
  299. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  300. # scan cron log for hs cmd
  301. crnl "grep \"({{ .chezmoi.group }}) CMD\" /var/log/syslog | tail -n 1 && hlg"
  302. # removes all but newest file
  303. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  304. snw "spotify-now -i '%artist - %title'"
  305. # ]]] spotify-lib-vis #
  306. shc "shellcheck"
  307. pdl "pdflatex"
  308. tcl "tex-clean"
  309. # mfs [[[ #
  310. mfs "nvim {{ .chezmoi.homedir }}/coding/best-mf-site-personal/index.html"
  311. ht "python3 -m http.server"
  312. # j "jekyll"
  313. # js "jekyll serve"
  314. h "hugo"
  315. he "hugo serve -D --disableFastRender"
  316. ss "ssh {{ .chezmoi.group }}@192.168.0.100"
  317. ssb "ssh-bandit"
  318. rt "python ~/coding/rt-scraper/!rt-scraper.py"
  319. # ]]] mfs #
  320. med "printf '\033c' && bear make move_mouse_with_head && ./move_mouse_with_head"
  321. # ]]] coding projs #
  322. # school [[[ #
  323. # 369 [[[ #
  324. wlf "watson log --all --tag=final"
  325. wrf "watson report --all --tag=final"
  326. ssc "ssh mokkar@teach.cs.utoronto.ca"
  327. ma "printf '\033c' && bear make"
  328. mc "bear make clean"
  329. mca "bear make clean && printf '\033c' && bear make"
  330. rmc "rm compile_commands.json"
  331. rms "rm swapfile.*"
  332. # ]]] 369 #
  333. # 309 [[[ #
  334. wl0 "watson log --all --project=309 --tag=phase2"
  335. wr0 "watson report --all --project=309 --tag=phase2"
  336. # server [[[ #
  337. nd "node"
  338. ndm "nodemon"
  339. knd "killall node"
  340. mg "mongo"
  341. 0ht "cd ~/school/309-proj && python3 -m http.server"
  342. mgd "mongod --dbpath mongo-data"
  343. # nds "killall node && nodemon server.js"
  344. nds "nodemon server.js"
  345. # ]]] server #
  346. # heroku [[[ #
  347. hr "heroku"
  348. hrs "heroku local web"
  349. hrt "heroku ps"
  350. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  351. gpsh "git push heroku"
  352. 0c "node collections.js"
  353. # ]]] heroku #
  354. # ]]] 309 #
  355. # ]]] school #