Update zsh

This commit is contained in:
Jeffrey Serio 2024-05-01 14:37:40 -05:00
parent c81ed8912c
commit ca1f089850
3 changed files with 45 additions and 4 deletions

View File

@ -87,7 +87,7 @@ zplug load
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
export SHELL=/usr/bin/zsh export SHELL=/usr/bin/zsh
export DOOMDIR="${HOME}/sync/doom" export DOOMDIR="${HOME}/sync/doom"
export LS_COLORS=$(cat ~/.lscolors.sh) export LS_COLORS=$(vivid generate catppuccin-mocha)
export PAGER="less -X" export PAGER="less -X"
export MANWIDTH="88" export MANWIDTH="88"
export MANROFFOPT="-c" export MANROFFOPT="-c"

View File

@ -1,6 +1,3 @@
# Execute bash on host (ostree-based)
alias hostexec='distrobox-host-exec bash'
# Get top 10 shell commands # Get top 10 shell commands
alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10' alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'

View File

@ -1,3 +1,47 @@
## Nushell and jc functions
# nushell: df
function nudf() {
nu -c 'jc df | from json'
}
# nushell: free
function numem() {
nu -c 'jc free | from json'
}
# nushell: lsof -i
function nunetcons() {
nu -c 'jc lsof -i | from json'
}
# nushell: nutulp
function nutulp() {
nu -c 'jc ss -tulp | from json'
}
# nushell: openports
function nuopenports() {
nu -c 'sudo jc lsof -i | from json | find "LISTEN"'
}
# nushell: timestamp Z
function nutsz() {
nu -c 'date now | format date "%FT%T%:z"'
}
# watch directory listing, update every 0.1s
function watchdir() {
watch -n0,1 "ls -lh $1/ | tail"
}
# get time in timezone
function timein() {
continent=$(find /usr/share/zoneinfo -maxdepth 1 -mindepth 1 -type d -not -name "posix" -not -name "right" -exec basename {} \; | gum choose --limit=1)
city=$(find "/usr/share/zoneinfo/$continent" -type f -exec basename {} \; | gum choose --limit=1)
TZ="$continent/$city" date
}
# Generate a pseudo-random 16-character string. # Generate a pseudo-random 16-character string.
function genrand() { function genrand() {
openssl rand -base64 16 openssl rand -base64 16