summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-10-31 18:26:16 -0400
committerGalen Guyer <galen@galenguyer.com>2022-10-31 18:26:16 -0400
commit6c4022028dcf8e316aa30cfa1b29eb2adee83b6d (patch)
treeb0e4e41c27fe7451f5fd716a78ed4d3730654548
parent63a39c8081ec734968d39693096bd60d6b91c8a4 (diff)
zshrc updates
-rw-r--r--modules/20-zsh/zshrc37
1 files changed, 34 insertions, 3 deletions
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
+}