Commit 9b8579d
xxwhirlpool
·
2026-07-04 10:12:15 -0400 EDT
parent 0281733
bashrc mariposa, `charge` to check battery status on laptop
3 files changed,
+31,
-0
+2,
-0
| ... | ... | @@ -5,6 +5,8 @@ config/.config/conky/wttr.png | |
| 5 | 5 | config/.bashrc | |
| 6 | 6 | config/.local/bin/pusheu | |
| 7 | 7 | ||
| 8 | + | config/.local/share/urlref | |
| 9 | + | ||
| 8 | 10 | config/.local/bin/fd | |
| 9 | 11 | config/.local/bin/hyfetch | |
| 10 | 12 | config/.local/bin/neowofetch |
+3,
-0
| ... | ... | @@ -185,6 +185,9 @@ PERL_LOCAL_LIB_ROOT="/home/kat/.perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_RO | |
| 185 | 185 | PERL_MB_OPT="--install_base \"/home/kat/.perl5\""; export PERL_MB_OPT; | |
| 186 | 186 | PERL_MM_OPT="INSTALL_BASE=/home/kat/.perl5"; export PERL_MM_OPT; | |
| 187 | 187 | ||
| 188 | + | # golang shit | |
| 189 | + | export GOPATH="$HOME/.go" | |
| 190 | + | ||
| 188 | 191 | ###################################### | |
| 189 | 192 | # functions | |
| 190 | 193 | ###################################### |
+26,
-0
| ... | ... | @@ -0,0 +1,26 @@ | |
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | # | |
| 3 | + | # check battery status on my laptop, but cute | |
| 4 | + | ||
| 5 | + | # check if not running on laptop (mariposa hostname) | |
| 6 | + | if [[ "$(hostname)" != "mariposa" ]]; then | |
| 7 | + | echo "only works on your laptop, dumbass" | |
| 8 | + | fi | |
| 9 | + | ||
| 10 | + | # styling stuff | |
| 11 | + | gum_border() { | |
| 12 | + | # echo in here so i can use newlines in the msg (\n) | |
| 13 | + | echo -e "$@" | gum style --foreground "#a6d189" --border-foreground "#99d1db" --border double --width 50 --padding "0 0" --align center | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | gum_echo_custom() { | |
| 17 | + | # $* here to sub in the $charge_percent variable | |
| 18 | + | gum style --foreground "#f4b8e4" --width 50 --padding "0 0" --align center "current: $*" | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | # get the battery percentage (minus the % sign ofc) | |
| 22 | + | charge_percent=$(upower -i "$(upower -e | grep 'BAT')" | awk '/percentage/ {print $NF}' | sed 's/%//g') | |
| 23 | + | ||
| 24 | + | # display it | |
| 25 | + | gum_border "[ █ █ █ █ █ █ █ █ █ █ █ ]" # cute battery text art i found online | |
| 26 | + | gum_echo_custom "$charge_percent%" # show the percentage (prefixed with "current:") |