diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-05 21:57:40 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-05-05 21:57:40 +0200 |
| commit | 8f1bad5de975e24e641ff7a18a665f8a6cd48774 (patch) | |
| tree | 2cda6e3faa46108be5e9d5c9140ea166ca142edb /status | |
| parent | 71a43325c4b523c781202785390bb11149d204e7 (diff) | |
| download | scripts-8f1bad5de975e24e641ff7a18a665f8a6cd48774.tar.gz scripts-8f1bad5de975e24e641ff7a18a665f8a6cd48774.zip | |
Merged some status scripts into one. The functionality as changed a bit, check the source if you relied on notify-* scripts.
Diffstat (limited to '')
| -rwxr-xr-x | status | 29 |
1 files changed, 29 insertions, 0 deletions
| @@ -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 | |||
| 11 | sep=${1:-" | "} | ||
| 12 | |||
| 13 | time=$(date +"%H:%M:%S") | ||
| 14 | date=$(date +"%d %B %Y, %A") | ||
| 15 | |||
| 16 | bat="/sys/class/power_supply/BAT0" | ||
| 17 | if [ -d $bat ]; then | ||
| 18 | battery="Battery: $(cat $bat/capacity) $(cat $bat/status)" | ||
| 19 | else | ||
| 20 | battery="No battery" | ||
| 21 | fi | ||
| 22 | |||
| 23 | network=$(nmcli device status | head -n 2 | tail -n 1 | awk '{print "Network: " $4}') | ||
| 24 | |||
| 25 | events=$(sdep-list past | wc -l) | ||
| 26 | |||
| 27 | printf "$time$sep$date$sep$battery$sep$network" | ||
| 28 | [ -n "$events" ] && printf "$sep$events TODO tasks" | ||
| 29 | printf "\n" | ||
