From 500da620557e19c334882e50ffbd92d6e53a4b76 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 10 Jul 2024 11:51:20 +0200 Subject: status for OpenBSD --- status | 50 +++++++++++--------------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) (limited to 'status') diff --git a/status b/status index fcc4c28..44935cd 100755 --- a/status +++ b/status @@ -1,41 +1,13 @@ #!/bin/sh -# Prints some status info to stdout. Includes: -# - date and time -# - battery -# - wifi (requires nmcli) -# - past notifications (requires notify) - -# Usage: status [separator] - -sep=${1:-" | "} - -time=$(date +"%H:%M") -date=$(date +"%d %B %Y, %A") - -if [ "$(pulsemixer --get-mute)" -eq 1 ]; then - volume="Audio muted" -else - volume="Volume: $(pulsemixer --get-volume | awk '{print $1}')%" -fi - -bat="/sys/class/power_supply/BAT0" -if [ -d $bat ]; then - battery="Battery: $(cat $bat/capacity)% $(cat $bat/status)" -else - battery="No battery" -fi - -# NetworkManager has a dreadful command line interface -# It makes cry every time -# pls help -nwline="$(nmcli device status | head -n 2 | tail -n 1)" -nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')" -network="Network: $nwclean" - -noticount=$(notify show | wc -l) - -printf '%s' "$network$sep$volume$sep$battery$sep$date$sep$time" -[ "$noticount" = "1" ] && printf '%s' "$sep$(notify show)" -[ "$noticount" -gt "1" ] && printf '%s' "${sep}Unread items: $noticount" -printf '\n' +# Calls one of the system-specific status scripts to display +# a line of text with some status information (battery, date...) + +case "$(uname)" in +OpenBSD) + status-openbsd + ;; +*) + status-void + ;; +esac -- cgit v1.3