This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/shell/bash/aliases.bash

155 lines
4.5 KiB
Bash
Raw Normal View History

2017-02-07 16:16:45 -06:00
#!/usr/bin/env bash
# filesystem aliases
alias lx='ls -lXB' # order by filetype
alias lk='ls -lSr' # order by filesize reversed
alias lt='ls -ltr' # order by file modified time
alias lc='ls -ltcr' # order by filectime
alias lu='ls -ltur' # order by file access time
alias ls='ls -h --color --group-directories-first' # flat view w/ directories first
alias l='ls -h --color --group-directories-first' # same as above
alias ll='ls -lv --group-directories-first' # non-flat view
alias lm='ll | more'
alias lr='ll -R' # please don't - why is this even here...?
alias la='ll -A' # show all
alias tree='tree -Csuh'
2018-08-31 09:27:45 -05:00
alias f='fzf'
2018-09-25 21:32:34 -05:00
alias cp="rsync -ah --progress"
alias year="cal $(date +%Y)"
2020-01-06 11:15:30 -06:00
alias y="year"
2017-02-07 16:16:45 -06:00
# gets the newest function for the current directory (or the specified directory
# if one is provided)
function ltl() {
local d="${1-$PWD}"
unset -v l
for f in "$d"/*; do
[[ $f -nt $l ]] && [[ ! -d $f ]] && l="$f"
done
echo "$l"
}
2019-12-31 10:15:01 -06:00
function ltld() {
local d="${1-$PWD}"
unset -v l
for f in "$d"/*; do
[[ $f -nt $l ]] && [[ -d $f ]] && l="$f"
done
echo "$l"
}
alias vltl="vim \"\$(ltl)\""
2019-12-31 10:15:01 -06:00
alias cdltl="cd \"\$(ltld)\""
2019-11-02 19:42:38 -05:00
alias ltlv="vltl"
2017-02-07 16:16:45 -06:00
# navigation aliases
2018-08-09 09:40:14 -05:00
function c() {
if [[ -n $1 ]]; then
cd "${NICE_HOME}" || exit 1
else
cd "${NICE_HOME}" && cd "${1}" || exit 1
2018-08-09 09:40:14 -05:00
fi
}
2017-02-07 16:16:45 -06:00
alias cd..="cd .."
alias cdd="cd \"\$DOTFILES_PATH\"" # go to dotfiles
2020-01-20 09:12:52 -06:00
alias cde="cd \"\$ENV_PATH\"" # go to current dotfiles...? env
2019-12-31 10:15:01 -06:00
alias cdc="cd \"\$XDG_CONFIG_HOME\"" # go to ~/.config
2018-11-03 14:17:39 -05:00
alias cdn="cd \"\$NOTES_PATH\""
2019-08-06 12:33:23 -05:00
alias cdl="cd \"\$NICE_HOME/dl\""
2019-08-23 09:45:26 -05:00
alias cdg="cd \"\$NICE_HOME/games\""
2018-08-09 09:40:14 -05:00
2017-02-07 16:16:45 -06:00
# quick parent-directory aliases
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias .......="cd ../../../../../.."
alias ........="cd ../../../../../../.."
alias .........="cd ../../../../../../../.."
# tmux aliases
# TODO: see if this can be worked around?
alias tmnew="tmux new -s"
alias tmls="tmux list-sessions"
alias tmatt="tmux attach -t"
alias tu="tmux attach -t utils || tmux new -s utils"
alias tdf="tmux attach -t dotfiles || tmux new -s dotfiles -c \"\$DOTFILES_PATH\""
alias tmon="tmux attach -t monitoring || tmux new -s monitoring"
alias tcom="tmux attach -t comms || tmux new -s comms"
2019-05-08 13:31:23 -05:00
alias tn="tmux attach -t notes || tmux new -s notes -c \"\$NOTES_PATH\""
2019-08-13 16:18:27 -05:00
alias tm="tmux attach -t music || tmux new -s music"
2017-02-07 16:16:45 -06:00
# git aliases
# TODO: make these git aliases in the gitconfig?
2019-08-10 21:40:35 -05:00
g() {
if [[ $# == '0' ]]; then
git status
else
git $*
fi
}
2017-02-07 16:16:45 -06:00
alias gs="git status"
2019-02-04 01:43:53 -06:00
alias gd="git diff"
2019-07-03 13:42:36 -05:00
alias gds="git diff --staged"
2019-08-10 21:40:35 -05:00
# alias gdv="git dv" # TODO: what is this?
2017-02-07 16:16:45 -06:00
alias gpl="git pull"
2018-10-31 14:40:57 -05:00
alias gp="git push"
alias gpa="git push --all && git push --tags"
2019-08-13 16:18:27 -05:00
alias gpt="git push && git push --tags"
2019-08-10 21:40:35 -05:00
alias gpf="git push --force-with-lease"
alias gac="git add -A && git commit"
2019-11-28 08:22:41 -06:00
alias gacnv="git add -A && git commit --no-verify"
alias gsur="git submodule update --remote"
2018-08-31 09:27:45 -05:00
alias glf="git ls-files"
2019-03-06 12:20:34 -06:00
alias gl="git log --pretty=format:\"%h %ad%x09%an%x09%s\" --date=short"
2017-02-07 16:16:45 -06:00
2019-01-29 08:08:34 -06:00
# docker aliases
alias dlf="docker logs --tail=500 -f"
alias dclf="docker-compose logs --tail=500 -f"
2019-01-29 08:10:42 -06:00
alias ctop="docker run --rm -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest"
2019-01-29 08:08:34 -06:00
2017-02-07 16:16:45 -06:00
# misc aliases
2018-08-09 09:40:14 -05:00
alias p="ping 8.8.8.8"
2017-04-25 07:59:41 -05:00
alias C="clear && clear"
alias r="ranger"
2019-02-22 09:27:43 -06:00
alias rn="/usr/bin/watch -n 1"
alias sctl="sudo systemctl"
alias sctlu="systemctl --user"
alias logs="sudo journalctl"
alias logsr="sudo journalctl -r"
alias logsf="sudo journalctl -f"
2019-12-12 11:02:24 -06:00
alias bt="sudo bluetoothctl"
alias btctl="bt"
Squashed commit of the following: commit 74cc8fa92e890153855597467cb0cc6981acb5ba Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Jan 24 12:45:49 2020 -0600 MIC SCRIPT commit dbd88dde4bc4e03e57505983c0fb199d8625122d Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Jan 23 12:38:19 2020 -0600 Mic script, amd stuff, more fish fixes commit dadb7da642d1b7fbf27612c2e0f4b9aae457931a Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Jan 23 09:51:03 2020 -0600 Remove more generated fish stuff, more fixes commit b09a25cc17561ed4e97690dfd1decac3fc49e279 Author: Daniel Flanagan <daniel@lytedev.io> Date: Wed Jan 22 17:25:47 2020 -0600 More fixes to various things commit 58f662628019d56458a537e487bc5e630220a6ac Author: Daniel Flanagan <daniel@lytedev.io> Date: Wed Jan 22 08:34:12 2020 -0600 Updates commit 00e919f7f53f046fbd621dd92a30376020bd73ff Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 14:28:45 2020 -0600 Fix notes and add vim pager commit 5100983350a9e9a30b0b87cc56897bbca521daa2 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 14:01:06 2020 -0600 More fixes and cleanup commit 85eab2155c7b884e5426790263e329df60c9c2dc Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 13:09:31 2020 -0600 More notes commit da496b7f0c41b0cfaa888782ce3773f05096f868 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 12:43:55 2020 -0600 Maybe actually fix colors? commit 3c11353256bebd3e543b65373f5130ea19badf05 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 12:32:23 2020 -0600 Colors fixed? commit f2a5060e7dd7e77a10e6e75e25b3a178ee2c7c03 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 11:40:26 2020 -0600 Things commit f44d0d54799ebbf7a59fad032a83cfa0d7da645a Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 10:54:09 2020 -0600 Kitty colors commit 5f0fa76a67db2e933faf6bcc158e89b14e778112 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 10:49:06 2020 -0600 More updates for fish migration commit 5b05be9fe7b353589f771dd3c09ec2be2803e1be Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 09:14:08 2020 -0600 Nah commit fe0f1d8e32f990a43f510433a7cfc85c02fcfabc Merge: 52fe38f 205c12a Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 09:13:09 2020 -0600 Merge branch 'dev' of ssh://git.lyte.dev:2222/lytedev/dotfiles into dev commit 52fe38f42a84b5afd6b00bf6e2afe6e93e25f77d Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 20 09:12:52 2020 -0600 More fish fixes commit 205c12a0517fa09c711d2abdbc6ee2cc02f22ecd Author: Daniel Flanagan <daniel@lytedev.io> Date: Sat Jan 18 23:15:13 2020 -0600 WIP commit b73c4b26a4bcaedfa03e540035a57434972ce27a Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Jan 17 10:36:20 2020 -0600 Remove debug code, fix asdf references for fish commit d6ecaf88be5f6e56321d123a6651007048183d53 Merge: 2e6b90b 46793bb Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Jan 17 10:34:01 2020 -0600 Merge remote-tracking branch 'origin/lappy' into dev commit 2e6b90bed3d61dc53a055ab83c3ae885f4361140 Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Jan 17 10:26:00 2020 -0600 Pulsemixer > pavucontrol and some sway fixes commit 46793bb7353dc964191c67162c416bdd372a992d Author: Daniel Flanagan <daniel@lyte.dev> Date: Fri Jan 17 03:02:53 2020 -0600 Whew commit 26f32a0c6b5934fbbfe3dabd03e945957df4a0f6 Author: Daniel Flanagan <daniel@lyte.dev> Date: Thu Jan 16 17:01:59 2020 -0600 WIP fish configuration commit fb0389eea4124d2b3a1866aef846c42c389a69e3 Author: Daniel Flanagan <daniel@lyte.dev> Date: Thu Jan 16 13:30:35 2020 -0600 Fiiiish commit 2f1af8411adec6ae34d122dfb02b666ea3b4f097 Author: Daniel Flanagan <daniel@lyte.dev> Date: Thu Jan 16 13:28:23 2020 -0600 Stuff commit ba8ec1f5248f1c30c7ab69f73cd05ca223631712 Author: Daniel Flanagan <daniel@lyte.dev> Date: Thu Jan 9 19:02:31 2020 -0600 Fix some dock stuff, erlang with wx commit d80a823ce2723f9ab283ee92cda30644e00cd770 Merge: 36d58e0 5195a85 Author: Daniel Flanagan <daniel@lytedev.io> Date: Wed Jan 8 13:32:56 2020 -0600 Merge remote-tracking branch 'origin/lappy' into wip-refactor commit 36d58e037f830475af636cdbde0b6ffd2dc9ec30 Author: Daniel Flanagan <daniel@lytedev.io> Date: Wed Jan 8 10:59:45 2020 -0600 Testing signed commits commit 5195a855a6619cbe72af8c806bca5de8d30cecc5 Author: Daniel Flanagan <daniel@lyte.dev> Date: Tue Jan 7 19:38:43 2020 -0600 Bars commit 1acb330746b88b6e1a1660fd2dd3166829775b5a Author: Daniel Flanagan <daniel@lyte.dev> Date: Tue Jan 7 11:36:12 2020 -0600 SWAAAAAY commit f547e5ec2848c4963129d756d7388dbabd15f73c Merge: aa29acb b1709d1 Author: Daniel Flanagan <daniel@lyte.dev> Date: Tue Jan 7 10:59:24 2020 -0600 Merge remote-tracking branch 'origin/wip-refactor' into lappy commit b1709d1e94b13199184fb1c8b95fb6b7f7c96a2f Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Jan 7 10:59:22 2020 -0600 Stuff commit aa29acb364023a109d562fcdf0338477ec7aa213 Merge: 66cc873 2456dad Author: Daniel Flanagan <daniel@lyte.dev> Date: Tue Jan 7 10:58:29 2020 -0600 Merge remote-tracking branch 'origin/wip-refactor' into lappy commit 2456dad7def9c24442ba33b94dbe2ae0b2e0d267 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Jan 6 11:15:30 2020 -0600 Zstd commit 66cc8734a82055d05b42ad63821ec35466b960ea Author: Daniel Flanagan <daniel@lyte.dev> Date: Tue Dec 31 21:48:49 2019 -0600 Fix sudo setup and use fancy email for git commit a05c02e1fb31a6c44d442ddda43ffb8ef5e74b9b Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Dec 31 17:03:22 2019 -0600 Fancy colors commit 026220fe2623fd4bcccbb8b5aeae003bfce1c53f Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Dec 31 16:55:45 2019 -0600 SMTP tools commit e2a854df650710ee7cf32f713d8edf0d198d23be Merge: 0d0e131 825d91b Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Dec 31 15:07:09 2019 -0600 Merge branch 'wip-refactor' into lappy commit 0d0e131714c756be933e158919908c19e0c35b2b Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Dec 31 14:26:44 2019 -0600 Stuff commit 825d91b46250c283ddc6f128d8857bbb4b31e8cf Author: Daniel Flanagan <daniel@lytedev.io> Date: Tue Dec 31 10:15:01 2019 -0600 Utility updates commit ae350894af674e454882197c11a312063b6df050 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Dec 30 10:02:14 2019 -0600 Lul. commit ea5debe38cf18bd4ad1b02e756e6ae6acc9a214b Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Dec 16 17:21:44 2019 -0600 WIP chat system commit c40fe94b7027ba9a58786fe4683e3b076b551ccd Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Dec 16 09:57:21 2019 -0600 Add weechat config commit 76e8a68c34dcbce613255dc4e6c4a7e5b643ce53 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Dec 16 09:51:21 2019 -0600 Preparing for weechat stuf commit 25aecdc139099c904d60b9c02b4adace7ea1acd8 Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Dec 13 11:32:15 2019 -0600 Goodies? commit 8d1e86feb4ebccec06233f8ea1f67b75d63cf222 Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 12 13:31:18 2019 -0600 Logging for pipelines? commit b81bdf6abd767e4f071e78b8478c52eab4a75479 Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 12 13:17:20 2019 -0600 errors break things? commit 6f7d80d761f0879e241c8d6ede24ad2199b674d1 Merge: 7659442 bc5ce9e Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 12 13:04:52 2019 -0600 Merge branch 'master' of ssh://git.lyte.dev:2222/lytedev/dotfiles commit 76594427ff4b991b4695847d2c3d0d110932c0c5 Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 12 13:00:03 2019 -0600 Pipelines! commit 972508e74de6e41fd2633b1405c032935f8d9a3c Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 12 11:02:24 2019 -0600 WIP pipeline commit 898848669cfd5f26e9034295d7c5d3c2401fca09 Author: Daniel Flanagan <daniel@lytedev.io> Date: Fri Dec 6 10:08:42 2019 -0600 Archive commit 16895af7988aaf53b0dcbeb19c598f601ba2773c Author: Daniel Flanagan <daniel@lytedev.io> Date: Thu Dec 5 16:09:52 2019 -0600 Helpful bins commit 3a8eb5d475cba74985e89f4f779827b6e60c4755 Author: Daniel Flanagan <daniel@lytedev.io> Date: Mon Dec 2 09:31:28 2019 -0600 Move a lot of stuff around
2020-01-24 12:46:51 -06:00
alias pbcopy="clip"
2019-12-31 10:15:01 -06:00
alias pbcopy="clip"
alias pt="htop -t" # experimental htop tree-view-by-default
alias resrc="source \$HOME/.bashrc"
2018-11-03 14:05:58 -05:00
alias redshift="redshift -r -l 39.0997:-94.5786 -t 6500K:2500K"
2020-04-20 10:38:19 -05:00
alias noredshift="killall redshift; redshift -P -O 5700"
alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar"
alias t="task"
2019-02-27 23:29:49 -06:00
alias sc="sc-im"
alias scs="sc-im \"\$NOTES_PATH/_scratch.sc\""
2019-09-06 14:42:53 -05:00
alias disks="lsblk && df -h"
alias dd="dd status=progress"
2019-10-31 12:42:25 -05:00
alias wifi="sudo nmtui"
alias pa="pulsemixer"
2017-02-07 16:16:45 -06:00
# games aliases
# this sometimes fixes steam dynamic library issues?
2018-11-08 07:32:36 -06:00
alias lsteam="LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so' steam"
2017-02-07 16:16:45 -06:00
2018-11-08 07:32:36 -06:00
# override the man commands with vim
2017-02-07 16:16:45 -06:00
alias _man="\\man"
alias man="vman"
# neomutt is better
alias mutt="neomutt"
2019-09-06 14:42:53 -05:00
# fsw aliases
alias fsw-mix-test="fsw \"mix test\" ./**/*.{ex,exs,erl,hrl,xrl,yrl}"
2019-12-16 17:21:44 -06:00
# weechat aliases
2020-01-20 09:12:52 -06:00
alias chat="WEECHAT_PASSPHRASE=\"\$(pass config/weechat-passphrase | head -n 1)\" weechat"