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.

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