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