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.

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