From 6c4022028dcf8e316aa30cfa1b29eb2adee83b6d Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Mon, 31 Oct 2022 18:26:16 -0400 Subject: zshrc updates --- modules/20-zsh/zshrc | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/20-zsh/zshrc b/modules/20-zsh/zshrc index 9c2543e..c820230 100644 --- a/modules/20-zsh/zshrc +++ b/modules/20-zsh/zshrc @@ -126,10 +126,15 @@ if [[ -d "$HOME/.local/bin" ]]; then export PATH="$HOME/.local/bin:$PATH" fi +# asdf-vm +if [[ -d "/opt/asdf-vm/" ]]; then + source "/opt/asdf-vm/asdf.sh" +fi + # esp32-rs if [[ -d "$HOME/.espressif" ]]; then - export PATH="$HOME/.espressif/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-x86_64-unknown-linux-gnu/bin/:$HOME/.espressif/tools/xtensa-esp32-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-unknown-linux-gnu/bin/:$PATH" - export LIBCLANG_PATH="$HOME/.espressif/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-x86_64-unknown-linux-gnu/lib/" + export LIBCLANG_PATH="/home/chef/.espressif/tools/xtensa-esp32-elf-clang/esp-14.0.0-20220415-x86_64-unknown-linux-gnu/lib/" + export PATH="/home/chef/.espressif/tools/xtensa-esp32-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-unknown-linux-gnu/bin/:/home/chef/.espressif/tools/xtensa-esp32s2-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-unknown-linux-gnu/bin/:/home/chef/.espressif/tools/xtensa-esp32s3-elf-gcc/8_4_0-esp-2021r2-patch3-x86_64-unknown-linux-gnu/bin/:$PATH" export PIP_USER="no" fi @@ -138,9 +143,35 @@ if [[ -z "$SSH_AUTH_SOCK" ]]; then fi if [[ -d "$HOME/.deta" ]]; then - export PATH="$HOME/.deta/bin:$PATH" + export PATH="$HOME/.deta/bin:$PATH" fi func bottom() { cat /dev/urandom | env LC_CTYPE=C tr -dc "asdfghjkl;" | fold -w 20 | head -n 1 } + +function bats() { + _concat=0 + for _battery in "/sys/class/power_supply/BAT"*; do + _capacity="$(< "${_battery}/capacity")" + _status="$(< "${_battery}/status")" + _health="$(($(cat ${_battery}/energy_full) * 100 / $(cat ${_battery}/energy_full_design)))" + if [[ "${_concat}" -eq "1" ]]; then + echo -n ", " + fi + echo -n "$(basename ${_battery}): ${_capacity}% (${_status})" + _concat=1 + done + echo +} + +function pyvenv() { + if [[ -d "./venv" ]]; then + source "./venv/bin/activate" + elif [[ -d "./env" ]]; then + source "./env/bin/activate" + else + python -m venv venv + source "./venv/bin/activate" + fi +} -- cgit v1.2.3