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.

503 lines
11 KiB

6 years ago
6 years ago
5 years ago
6 years ago
6 years ago
6 years ago
5 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
6 years ago
  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 +x"
  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. ct "crontab"
  45. cte "crontab -e"
  46. wm "sudo wifi-menu"
  47. # mounting [[[ #
  48. udm "udisksctl mount -b"
  49. udmb "udisksctl mount -b /dev/sdc2"
  50. udu "udisksctl unmount -b"
  51. udub "udisksctl unmount -b /dev/sdc2"
  52. # ]]] mounting #
  53. tc "touch"
  54. vdr "vidir --verbose"
  55. # directory-related [[[ #
  56. ls "lsd"
  57. l "lsd -a"
  58. ll "lsd -al"
  59. smv "sudo mv"
  60. f "cd"
  61. fz "fzf"
  62. fnd "find . -type f -name"
  63. rmr "rm -rf"
  64. rmd "rm ~/Downloads/*"
  65. rmw "rm ~/.local/share/nvim/swap/"
  66. md "mkdir -p"
  67. rsy "rsync -Pr"
  68. # list all (un)mounted drives
  69. lhd "sudo fdisk -l"
  70. # get disc space for mounted drives
  71. # ds "df -h | tee >(head -n 1) >(grep sd) >/dev/null"
  72. ds "df -h | head -n 1 && df -h | grep sd"
  73. chownw "sudo chown -R {{ .chezmoi.group }}:wheel"
  74. chwnm "sudo chown -R {{ .chezmoi.group }}:wheel /run/media/{{ .chezmoi.username }}"
  75. # cd into backup folder and show backup sizes
  76. nbu "cd /run/media/{{ .chezmoi.group }}/backup-hd/{{ .chezmoi.fullHostname }}/tar && lsd -l"
  77. # ]]] directory-related #
  78. # power options [[[ #
  79. s "systemctl suspend"
  80. so "xset dpms force off"
  81. sd "systemctl poweroff"
  82. rb "systemctl reboot"
  83. lo "i3-msg exit"
  84. xm "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  85. X "xmodmap ~/.Xmodmap && xset r rate $XSET_DELAY $XSET_RATE"
  86. {{ if eq .chezmoi.fullHostname "x1-carbon" }}
  87. xl "xmodmap ~/.Xmodmap-laptop && xset r rate $XSET_DELAY $XSET_RATE"
  88. XL "xmodmap ~/.Xmodmap-laptop && xset r rate $XSET_DELAY $XSET_RATE"
  89. bt "~/linux-config/dot_config/i3blocks/scripts/executable_battery"
  90. {{ end }}
  91. # ]]] power options #
  92. # sound
  93. {{ if eq .chezmoi.fullHostname "nzxt" }}
  94. vlm "alsamixer -c 0"
  95. vlh "alsamixer -c 2"
  96. {{ else }}
  97. vlm "alsamixer -c 1"
  98. {{ end }}
  99. # apt [[[ #
  100. # apti "sudo apt install"
  101. # aptr "sudo apt remove"
  102. # aptu "sudo apt upgrade"
  103. # ]]] apt #
  104. {{ if eq .chezmoi.osRelease.id "arch" }}
  105. # pacman [[[ #
  106. # pc "sudo pacman -S"
  107. # pcq "sudo pacman -Qi"
  108. # pcr "sudo pacman -Rns"
  109. # pcud "sudo pacman -Sy"
  110. # pcug "sudo pacman -Syu"
  111. # xpc "pacman -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && pacman -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  112. # ]]] pacman #
  113. # tri "trizen -S --noconfirm"
  114. tri "trizen -S --noedit"
  115. # yay [[[ #
  116. # install
  117. ya "yay -S --answerclean=None --answerdiff=None --answeredit=None"
  118. # info
  119. yaq "yay -Qi"
  120. # remove
  121. yar "yay -Rns"
  122. # sync
  123. yau "yay -Sy"
  124. # sync and download
  125. yadl "yay -Syuw --answerclean=None --answerdiff=None --answeredit=None"
  126. # sync and update
  127. yaug "yay -Syu --answerclean=None --answerdiff=None --answeredit=None"
  128. # export packages
  129. xya "yay -Qqne > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-pkgs.txt && yay -Qqme > ~/{{ .chezmoi.os }}-config/txt/{{ .chezmoi.fullHostname }}-aur.txt "
  130. # ]]] yay #
  131. {{ end }}
  132. py "python"
  133. pyt "pytest -vv"
  134. pyu "python -m unittest"
  135. pipi "pip install"
  136. spipi "sudo pip install"
  137. # internet
  138. pg "ping -c 2 -W 1 8.8.8.8"
  139. pgc "ping 8.8.8.8"
  140. dh "sudo dhcpcd"
  141. kdh "sudo killall dhcpcd"
  142. rdh "sudo killall dhcpcd && sudo dhcpcd"
  143. id "identify"
  144. # rz "source ~/{{ .chezmoi.os }}-config/aliases/zsh_aliases"
  145. # mst "sudo rm ~/st/config.h && sudo bear make -C ~/st install"
  146. mst "sudo ~/st/make-st.sh"
  147. # system ]]]
  148. # applications [[[ #
  149. # silent="> /dev/null 2>&1& "
  150. chr "google-chrome"
  151. clc "cloc ."
  152. cv "cava"
  153. dg "dragon-drag-and-drop -x"
  154. fh "feh"
  155. gpd "gpg --decrypt"
  156. gpe "gpg --encrypt --recipient"
  157. htc "htop -s PERCENT_CPU"
  158. htm "htop -s PERCENT_MEM"
  159. i "sxiv"
  160. ig "sxiv -a"
  161. it "sxiv -t *"
  162. ka "killall"
  163. kd "killall Discord && killall Discord && killall slack"
  164. kt "killall thunderbird"
  165. mp "mpv --volume=50"
  166. mra "man ranger"
  167. n "nvim"
  168. p3 "python3"
  169. pdft "pdftotext"
  170. pipes "pipes.sh -t 3"
  171. py "python"
  172. r "ranger"
  173. rg "printf '\033c' && rg"
  174. rx "redshift -x"
  175. sn "sudo nvim"
  176. sw "swex"
  177. vmd "vimdiff"
  178. wg "wego"
  179. wp "grep wallpaper ~/.cache/wal/colors.sh"
  180. z "zathura --fork"
  181. lz "unzip -l"
  182. # pass [[[ #
  183. ps "pass"
  184. psc "pass -c"
  185. pse "pass edit"
  186. psi "pass insert -m"
  187. psg "pass generate -c"
  188. pss "pass show"
  189. xc "xclip -selection clipboard"
  190. yh "echo 'kevin.mok@live.ca' | xclip -selection clipboard"
  191. yg "xclip -selection clipboard ~/.password-store/social/gmail"
  192. yt "xclip -selection clipboard ~/.password-store/social/trapbot"
  193. yu "echo 'kevin.mok@mail.utoronto.ca' | xclip -selection clipboard"
  194. # ]]] pass #
  195. # watson [[[ #
  196. w "watson"
  197. wa "watson start"
  198. wae "watson start && watson edit"
  199. we "watson edit"
  200. wl "watson log --day"
  201. wla "watson log --all --tag="
  202. ww "watson log"
  203. # wlm "watson log --project coding --tag mfs"
  204. wr "watson report --day"
  205. wra "watson report --all"
  206. wrw "watson report"
  207. wre "watson restart"
  208. wree "watson restart && watson edit"
  209. ws "watson status && watson stop"
  210. wse "watson stop && watson edit"
  211. wsc "watson cancel"
  212. wsl "watson stop && watson log --day"
  213. wt "watson status"
  214. # ]]] watson #
  215. # ]]] applications #
  216. # git [[[ #
  217. g "git"
  218. gstr "git config credential.helper store"
  219. gstrp "git config credential.helper store && git push"
  220. # branch [[[ #
  221. gb "git branch"
  222. gbd "git branch -D"
  223. gba "git branch --no-merged && echo '' && git branch --merged"
  224. gbu "git branch --no-merged"
  225. gbm "git branch --merged"
  226. gmg "git merge"
  227. gmgt "git mergetool"
  228. gr "git remote -v"
  229. gro "git remote show origin"
  230. # ]]] branch #
  231. # add/remove [[[ #
  232. ga "git add -A && git status -u"
  233. gac "git add -A && git commit -S"
  234. gaf "git add -f"
  235. # unsigned commt
  236. gacu "git add -A && git commit"
  237. grm "git rm"
  238. grmf "git rm -f"
  239. grmc "git rm --cached"
  240. grmfc "git rm -f --cached"
  241. grmor "rm (fd -e orig --no-ignore -H)"
  242. # ]]] add/remove #
  243. # diff/log [[[ #
  244. gd "git difftool -w --tool=vimdiff"
  245. gdc "git difftool -w --cached --tool=vimdiff"
  246. gdl "git diff -w"
  247. gdlc "git diff --cached -w"
  248. gdh "git diff --cached -w HEAD~1"
  249. gds "git diff --stat"
  250. gl "git log"
  251. glm "git log master"
  252. gsl "git shortlog"
  253. # ]]] diff/log #
  254. # pull [[[ #
  255. gcln "git clone"
  256. gs "git status -u"
  257. gf "git fetch origin"
  258. gcho "git checkout"
  259. gchon "git checkout -b"
  260. gchom "git checkout master"
  261. gchnw "git checkout -b wip"
  262. gchw "git checkout wip"
  263. grom "git reset --hard origin/master"
  264. gheadm1 "git reset --hard HEAD~1"
  265. # show files in git repo
  266. # gls "git ls-tree -r HEAD --name-only"
  267. gls "git ls-tree HEAD --name-only"
  268. gchp "git cherry-pick"
  269. gchpc "git cherry-pick --continue"
  270. gst "git stash"
  271. gstl "git stash list"
  272. gstp "git stash pop"
  273. gsts "git stash show stash@\{0\} -p"
  274. gclear "git stash clear"
  275. gpl "git pull --rebase"
  276. grb "git rebase -i"
  277. grba "git rebase --abort"
  278. grbc "git rebase --continue"
  279. # ]]] pull #
  280. # push [[[ #
  281. gc "git commit -S"
  282. gcu "git commit"
  283. gca "git add -A && git commit --amend --no-edit -S"
  284. gcam "git add -A && git commit --amend -S"
  285. # gcamp "git add -A && git commit --amend --no-edit -S && gpsf"
  286. psgi "git add -A && git commit -m 'Update' -S && git push"
  287. gps "git push"
  288. gpsi "git config credential.helper store && git push"
  289. # gpsn "git push --set-upstream origin master"
  290. gpsn "eval (git push 2>&1 | tail -n 2)"
  291. gpsf "git push --force"
  292. # assume file unchanged
  293. gunc "git update-index --assume-unchanged"
  294. # ]]] push #
  295. # ]]] git #
  296. # coding projs [[[ #
  297. rgt "rg TODO"
  298. # make [[[ #
  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. # ]]] make #
  304. # chezmoi [[[ #
  305. zm "chezmoi"
  306. za "chezmoi add"
  307. zar "chezmoi add -r"
  308. zd "chezmoi data"
  309. zdf "chezmoi diff"
  310. zp "chezmoi -v apply"
  311. # ]]] chezmoi #
  312. # spotify-lib-vis [[[ #
  313. # start spv server outside dir
  314. ssv "source ../bin/activate.fish && python manage.py runserver"
  315. # open spv db in psql
  316. spvdb "psql -d spotifyvis -U django"
  317. mig "python manage.py makemigrations && python manage.py migrate --run-syncdb && ssv"
  318. cldb "python manage.py flush --no-input && ssv"
  319. # django shell
  320. djs "python manage.py shell"
  321. # update pip
  322. upip "pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
  323. # update pip req's.
  324. ureq "pip freeze > requirements.txt"
  325. # show last history scan
  326. hlg "tail -n 5 $spv_dir/src/api/management/commands/update-history.log"
  327. # scan history
  328. # hs "$spv_dir/src/update-history.sh && cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
  329. # scan cron log for hs cmd
  330. crnl "grep \"({{ .chezmoi.group }}) CMD\" /var/log/syslog | tail -n 1 && hlg"
  331. # removes all but newest file
  332. # rmol "ls -t | tail -n +2 | xargs rm -- && l"
  333. snw "spotify-now -i '%artist - %title'"
  334. # ]]] spotify-lib-vis #
  335. shc "shellcheck"
  336. tll "tllocalmgr"
  337. tli "tllocalmgr install"
  338. # tlh "tllocalmgr texhash"
  339. pdl "pdflatex"
  340. tcl "tex-clean"
  341. # grocery-finder [[[ #
  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. # mfs [[[ #
  364. mfs "nvim ~/coding/best-mf-site-personal/index.html"
  365. ht "python3 -m http.server"
  366. # j "jekyll"
  367. # js "jekyll serve"
  368. h "hugo"
  369. he "hugo serve -D --disableFastRender"
  370. ss "ssh {{ .chezmoi.group }}@192.168.0.100"
  371. ssb "ssh-bandit"
  372. rt "python ~/coding/rt-scraper/!rt-scraper.py"
  373. # ]]] mfs #
  374. # ada-mario [[[ #
  375. mm "printf '\033c' && bear make clean move_mouse_with_head && ./move_mouse_with_head"
  376. med "printf '\033c' && bear make clean eye_detector && ./eye_detector"
  377. mft "printf '\033c' && bear make clean face_detector && ./face_detector"
  378. rft "~/coding/face-tracker/face_detector > /tmp/move_mouse_with_head.out"
  379. gpsb "git push bitbucket"
  380. # ]]] ada-mario #
  381. sac "source ../../bin/activate.fish"
  382. dea "deactivate"
  383. # ]]] coding projs #
  384. # school [[[ #
  385. # wlf "watson log --all --tag=final"
  386. # wrf "watson report --all --tag=final"
  387. ssc "ssh mokkar@teach.cs.utoronto.ca"
  388. jc "javac -d out *.java"
  389. jr "java -cp \"$CLASSPATH:out\""
  390. wl6 "watson log --all --project=263 --tag=a3"
  391. wr6 "watson report --all --project=263 --tag=a3"
  392. # ]]] school #