aboutsummaryrefslogtreecommitdiff
path: root/status
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xstatus29
1 files changed, 29 insertions, 0 deletions
diff --git a/status b/status
new file mode 100755
index 0000000..442e583
--- /dev/null
+++ b/status
@@ -0,0 +1,29 @@
1#!/bin/sh
2
3# Prints some status info to stdout. Includes:
4# - date and time
5# - battery
6# - wifi (requires nmcli)
7# - past reminders, if any (requires sdep and sdep-list)
8
9# Usage: status [separator]
10
11sep=${1:-" | "}
12
13time=$(date +"%H:%M:%S")
14date=$(date +"%d %B %Y, %A")
15
16bat="/sys/class/power_supply/BAT0"
17if [ -d $bat ]; then
18 battery="Battery: $(cat $bat/capacity) $(cat $bat/status)"
19else
20 battery="No battery"
21fi
22
23network=$(nmcli device status | head -n 2 | tail -n 1 | awk '{print "Network: " $4}')
24
25events=$(sdep-list past | wc -l)
26
27printf "$time$sep$date$sep$battery$sep$network"
28[ -n "$events" ] && printf "$sep$events TODO tasks"
29printf "\n"

Generated with cgit - Back to sebastiano.tronto.net