commit 6e6a3f2a743829518a1c44eebff39ba04f3c0446 from: noodle date: Thu Jul 10 23:45:50 2025 UTC Add the things commit - /dev/null commit + 6e6a3f2a743829518a1c44eebff39ba04f3c0446 blob - /dev/null blob + 0d992f0cecae54a68594431974a65493a8f00663 (mode 644) --- /dev/null +++ LICENSE @@ -0,0 +1 @@ +Public domain. blob - /dev/null blob + 54bb4f0534b12c1b55913d8864926d481c0224a1 (mode 755) --- /dev/null +++ dfs @@ -0,0 +1,9 @@ +#!/bin/sh +# prints df(1) then the totals of each statistic +# TODO: align the numbers for totals to match df(1) output +set -e +df -h | grep ^[a-zA-Z/] +df -k | awk ' + function human(kb) { order=1; while (kb >= 1000) { kb /= 1024; order++ }; return sprintf("%.1f%c", kb, substr("KMGTPE", order, 1)) } + NR > 1 && /^\/dev/ { devs++; size += $2; used += $3; avail += $4; cap += $5 } + END {printf "Total:\t\t\t\t%s\t%s\t%s\t%d%%\n", human(size), human(used), human(avail), cap/devs }' blob - /dev/null blob + c5fe48eb1a3a976f0020bf523c7ba55f03b393d6 (mode 755) --- /dev/null +++ dudu @@ -0,0 +1,3 @@ +#!/bin/sh +# du(1) but shows a sorted, human-readable listing of sizes of all entries +du -had 1 "$@" | sort -h blob - /dev/null blob + f3754cd75e971df802441ed1e51d4f3774219439 (mode 755) --- /dev/null +++ fget @@ -0,0 +1,3 @@ +#!/bin/sh +# some kinda openbsd curl(1)? +ftp -VMo - "$@" blob - /dev/null blob + 62887b29996388cd9e523de44a05042779016237 (mode 755) --- /dev/null +++ funstats @@ -0,0 +1,33 @@ +#!/bin/sh +# some cool stats for the tmux bar on openbsd + +vol () { + if [ "$(sndioctl -n output.mute)" -eq 1 ]; then + echo "muted" + else + sndioctl -n output.level | awk '{ printf "%d%%\n", int($0*100) }' + fi +} + +mic () { + if [ "$(sysctl -n kern.audio.record)" -eq 1 ] || + [ "$(sndioctl -n input.mute)" -eq 1 ]; then + printf "muted" + else + sndioctl -n input.level | awk '{ printf "%d%%\n", int($0*100) }' + fi +} + +bat () { + apm -l +} + +lidaction () { + [ "$(sysctl -n machdep.lidaction)" -eq 1 ] && printf "on" || printf "off" +} + +temp () { + sysctl -n hw.sensors.cpu0.temp0 | awk '{ print $1, "C" }' +} + +echo "|mic: $(mic)|vol: $(vol)|bat: $(bat)%|temp: $(temp)|lid: $(lidaction)|" blob - /dev/null blob + 43898f1cf760ceb1e1028893e8b8d547a1ad9e3c (mode 755) --- /dev/null +++ watch @@ -0,0 +1,7 @@ +#!/bin/sh +# gn* watch +while true; do + clear + "$@" + sleep 1 +done