From 409c1bd4ff4470737bbd7d9fee888608b7d7ddf1 Mon Sep 17 00:00:00 2001 From: xatier Date: Wed, 17 Jul 2024 19:55:10 -0500 Subject: [PATCH] feat(bashrc): update bashrc * add `black` alias * remove `helix` * add `j` and `jj` aliases * add `BROWSER` environment variable * add `archbox` function * update `jwtinfo` --- bashrc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index c173502..50f87e8 100644 --- a/bashrc +++ b/bashrc @@ -42,8 +42,10 @@ 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 &' @@ -51,10 +53,10 @@ 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' @@ -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" @@ -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" @@ -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() {