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