From 8f1bad5de975e24e641ff7a18a665f8a6cd48774 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 5 May 2022 21:57:40 +0200 Subject: Merged some status scripts into one. The functionality as changed a bit, check the source if you relied on notify-* scripts. --- status | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 status (limited to 'status') diff --git a/status b/status new file mode 100755 index 0000000..442e583 --- /dev/null +++ b/status @@ -0,0 +1,29 @@ +#!/bin/sh + +# Prints some status info to stdout. Includes: +# - date and time +# - battery +# - wifi (requires nmcli) +# - past reminders, if any (requires sdep and sdep-list) + +# Usage: status [separator] + +sep=${1:-" | "} + +time=$(date +"%H:%M:%S") +date=$(date +"%d %B %Y, %A") + +bat="/sys/class/power_supply/BAT0" +if [ -d $bat ]; then + battery="Battery: $(cat $bat/capacity) $(cat $bat/status)" +else + battery="No battery" +fi + +network=$(nmcli device status | head -n 2 | tail -n 1 | awk '{print "Network: " $4}') + +events=$(sdep-list past | wc -l) + +printf "$time$sep$date$sep$battery$sep$network" +[ -n "$events" ] && printf "$sep$events TODO tasks" +printf "\n" -- cgit v1.3