Skip to content

Commit

Permalink
feat(bashrc): update bashrc
Browse files Browse the repository at this point in the history
* add `black` alias
* remove `helix`
* add `j` and `jj` aliases
* add `BROWSER` environment variable
* add `archbox` function
* update `jwtinfo`
  • Loading branch information
xatier committed Jul 18, 2024
1 parent d644d88 commit 409c1bd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ alias la='ls -A'
alias ll='ls -AlFh'

alias a='alsamixer'
alias black='black --line-length 80'
alias bye='exit'
alias cd..='cd ..'
alias copy='xclip -selection clipboard'
alias d='deactivate'
alias delta='delta -sn'
alias edge='/usr/bin/microsoft-edge-dev &'
alias gerp='grep'
alias gi='git'
alias gt='git'
alias gti='git'
alias hx='helix'
alias ipy='ipython'
alias ivm='vim'
alias j='jagger'
alias j='sudachi'
alias jj='jagger'
alias open='xdg-open'
alias pbcopy='xclip -selection clipboard'
alias py='python'
Expand Down Expand Up @@ -99,6 +101,9 @@ export LC_ALL=en_US.UTF-8
# vim rocks
export EDITOR=vim

# for xdg-open
export BROWSER="/usr/bin/microsoft-edge-dev"

[[ -x /usr/bin/lesspipe.sh ]] && eval "$(SHELL=/bin/sh lesspipe.sh)"
export LESS="-R"

Expand Down Expand Up @@ -426,6 +431,13 @@ wormhole-kill() {
rm -rf "$venv_name"
}

# fast dev env
archbox() {
set -x
podman run --rm -it ghcr.io/xatier/arch-dev bash
set +x
}

diffoscope() {
local pwd
pwd="$PWD"
Expand Down Expand Up @@ -484,7 +496,10 @@ jwtinfo() {
# inspired by https://github.com/lmammino/jwtinfo
# ignore base64 error since JWT payload may not have proper '=' paddings
# https://jwt.io/introduction/
echo "$1" | cut -d '.' -f 2 | base64 -di 2>/dev/null
# header
echo "$1" | cut -d '.' -f 1 | base64 -di | jq 2>/dev/null
# payload
echo "$1" | cut -d '.' -f 2 | base64 -di | jq 2>/dev/null
}

exif-remove() {
Expand Down

0 comments on commit 409c1bd

Please sign in to comment.