Merge remote-tracking branch 'origin/main'

This commit is contained in:
Daniel Flanagan 2023-07-12 02:20:16 -05:00
commit 05def3ef2b
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
7 changed files with 37 additions and 5 deletions

View file

@ -59,8 +59,11 @@ end
# If we're running the shell interactively from inside Kitty, assume that we will be using Kitty's multiplexing features # If we're running the shell interactively from inside Kitty, assume that we will be using Kitty's multiplexing features
# Otherwise, assume we're in a context that is not capable of "native" multiplexing features and run everything inside Zellij # Otherwise, assume we're in a context that is not capable of "native" multiplexing features and run everything inside Zellij
if set --query FISH_START_ZELLIJ if not set --query ZELLIJ && set --query FISH_START_ZELLIJ && status is-interactive
eval (zellij setup --generate-auto-start fish | string collect) # simulate auto attach
else if set --query FISH_START_TMUX zellij attach -c
# simulate auto kill
kill $fish_pid
else if not set --query TMUX && set --query FISH_START_TMUX && status is-interactive
tmux att -t default || tmux new -s default tmux att -t default || tmux new -s default
end end

View file

@ -1,7 +1,12 @@
set MAX_PATH_PIECE_CHARS 3 set MAX_PATH_PIECE_CHARS 3
function get_hostname function get_hostname
if test (uname) = Linux || test (uname) = Darwin
has_command hostname && hostname --short || cat /etc/hostname has_command hostname && hostname --short || cat /etc/hostname
else
# assume bsd
hostname | head -n 1
end
end end
function fish_greeting function fish_greeting

View file

@ -41,7 +41,8 @@ pacman -Sy --needed --noconfirm \
gnu-netcat socat websocat `# Socket Utilities` \ gnu-netcat socat websocat `# Socket Utilities` \
nnn `# CLI File Manager` \ nnn `# CLI File Manager` \
avahi nss-mdns `# mDNS and Network Discovery Utilities` \ avahi nss-mdns `# mDNS and Network Discovery Utilities` \
dua-cli `# Disj Usage Abalyzer` \ git git-lfs `# Version Control` \
dua-cli `# Disk Usage Abalyzer` \
man-db man-pages `# Come On, Man!` man-db man-pages `# Come On, Man!`
# TODO: if paru? rtx-bin # TODO: if paru? rtx-bin

6
os/linux/bin/batmon Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env fish
while true
echo (date +%s)' '(batteries-combined-wattage) >> ~/.battlog
sleep 5
end

View file

@ -0,0 +1,3 @@
#!/usr/bin/env fish
cat /sys/class/power_supply/BAT*/power_now | rg . | awk '{print $1*10^-6}' | awk '{sum+=$1}END{print sum}'

5
os/linux/bin/batteries-watts Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env fish
for b in /sys/class/power_supply/BAT*/power_now
cat $b | rg . | awk '{print $1*10^-6 " W"}'
end

9
os/linux/bin/battplot Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env fish
echo '
set xdata time
set timefmt "%s"
set format x "%H:%M:%S"
# set yrange[0:96]
while (1) { plot "/home/daniel/.home/.battlog" using 1:2 with linespoints
pause 5 }
' | gnuplot