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.

460 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. gsts "git stash show stash@\{0\} -p"
  254. gclear "git stash clear"
  255. gpl "git pull --rebase"
  256. grba "git rebase --abort"
  257. grbc "git rebase --continue"
  258. # ]]] pull #
  259. # push [[[ #
  260. gc "git commit -S"
  261. gcu "git commit"
  262. gca "git add -A && git commit --amend --no-edit -S"
  263. gcam "git add -A && git commit --amend -S"
  264. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  265. psgi "git add -A && git commit -m 'Update' -S && git push"
  266. gps "git push"
  267. gpsi "git config credential.helper store && git push"
  268. # gpsn "git push --set-upstream origin master"
  269. gpsn "eval (git push 2>&1 | tail -n 2)"
  270. gpsf "git push --force"
  271. # assume file unchanged
  272. gunc "git update-index --assume-unchanged"
  273. # ]]] push #
  274. # ]]] git #
  275. # coding projs [[[ #
  276. rgt "rg TODO"
  277. # chezmoi [[[ #
  278. zm "chezmoi"
  279. za "chezmoi add"
  280. zar "chezmoi add -r"
  281. zd "chezmoi data"
  282. zp "chezmoi -v apply"
  283. # ]]] chezmoi #
  284. # spotify-lib-vis [[[ #
  285. # start spv server outside dir
  286. ssv "source ../bin/activate.fish && python manage.py runserver"
  287. # open spv db in psql
  288. spvdb "psql -d spotifyvis -U django"
  289. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  290. cldb "python manage.py flush --no-input && ssv"
  291. # django shell
  292. djs "python manage.py shell"
  293. # update pip
  294. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  295. # update pip req's.
  296. ureq "pip freeze > requirements.txt"
  297. # show last history scan
  298. hlg "cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  299. # scan history
  300. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  301. # scan cron log for hs cmd
  302. crnl "grep \"({{ .chezmoi.group }}) CMD\" /var/log/syslog | tail -n 1 && hlg"
  303. # removes all but newest file
  304. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  305. snw "spotify-now -i '%artist - %title'"
  306. # ]]] spotify-lib-vis #
  307. shc "shellcheck"
  308. pdl "pdflatex"
  309. tcl "tex-clean"
  310. # mfs [[[ #
  311. mfs "nvim ~/coding/best-mf-site-personal/index.html"
  312. ht "python3 -m http.server"
  313. # j "jekyll"
  314. # js "jekyll serve"
  315. h "hugo"
  316. he "hugo serve -D --disableFastRender"
  317. ss "ssh {{ .chezmoi.group }}@192.168.0.100"
  318. ssb "ssh-bandit"
  319. rt "python ~/coding/rt-scraper/!rt-scraper.py"
  320. # ]]] mfs #
  321. med "printf '\033c' && bear make move_mouse_with_head && ./move_mouse_with_head"
  322. # ]]] coding projs #
  323. # school [[[ #
  324. # 369 [[[ #
  325. wlf "watson log --all --tag=final"
  326. wrf "watson report --all --tag=final"
  327. ssc "ssh mokkar@teach.cs.utoronto.ca"
  328. ma "printf '\033c' && bear make"
  329. mc "bear make clean"
  330. mca "bear make clean && printf '\033c' && bear make"
  331. rmc "rm compile_commands.json"
  332. rms "rm swapfile.*"
  333. # ]]] 369 #
  334. # 309 [[[ #
  335. wl0 "watson log --all --project=309 --tag=phase2"
  336. wr0 "watson report --all --project=309 --tag=phase2"
  337. # server [[[ #
  338. nd "node"
  339. ndm "nodemon"
  340. knd "killall node"
  341. mg "mongo"
  342. 0ht "cd ~/school/309-proj && python3 -m http.server"
  343. mgd "mongod --dbpath mongo-data"
  344. # nds "killall node && nodemon server.js"
  345. nds "nodemon server.js"
  346. # ]]] server #
  347. # heroku [[[ #
  348. hr "heroku"
  349. hrs "heroku local web"
  350. hrt "heroku ps"
  351. hrl "heroku logs --dyno web -n 1500 | rg up | awk '{ system(\"date -d \" \$1); \$1 = \"\"; print \$0 }' | paste -s -d' \n'"
  352. gpsh "git push heroku"
  353. 0c "node collections.js"
  354. # ]]] heroku #
  355. # ]]] 309 #
  356. # ]]] school #