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.

384 lines
10 KiB

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