From acc08eb7aa16d39a598a8bf8631deda1e79ff477 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 15 Aug 2025 17:46:28 +0200 Subject: Some changes for new system config --- status-alpine | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 status-alpine (limited to 'status-alpine') diff --git a/status-alpine b/status-alpine new file mode 100755 index 0000000..fcc4c28 --- /dev/null +++ b/status-alpine @@ -0,0 +1,41 @@ +#!/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' -- cgit v1.3