aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-05-05 21:57:40 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2022-05-05 21:57:40 +0200
commit8f1bad5de975e24e641ff7a18a665f8a6cd48774 (patch)
tree2cda6e3faa46108be5e9d5c9140ea166ca142edb
parent71a43325c4b523c781202785390bb11149d204e7 (diff)
downloadscripts-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.
-rw-r--r--Makefile3
-rwxr-xr-xold/notify-battery (renamed from notify-battery)0
-rwxr-xr-xold/notify-time (renamed from notify-time)0
-rwxr-xr-xstatus29
4 files changed, 30 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1013b4e..0abcda8 100644
--- a/Makefile
+++ b/Makefile
@@ -18,8 +18,6 @@ SCRIPTS = addressgrep \
18 ffmpeg-facecam \ 18 ffmpeg-facecam \
19 mail-checknow \ 19 mail-checknow \
20 mail-compose \ 20 mail-compose \
21 notify-battery \
22 notify-time \
23 open-file \ 21 open-file \
24 open-stdin \ 22 open-stdin \
25 open-url \ 23 open-url \
@@ -30,6 +28,7 @@ SCRIPTS = addressgrep \
30 sel \ 28 sel \
31 sfeed-browser \ 29 sfeed-browser \
32 spawn \ 30 spawn \
31 status \
33 templess \ 32 templess \
34 terminal \ 33 terminal \
35 togglemute \ 34 togglemute \
diff --git a/notify-battery b/old/notify-battery
index 0294b70..0294b70 100755
--- a/notify-battery
+++ b/old/notify-battery
diff --git a/notify-time b/old/notify-time
index 4b77c74..4b77c74 100755
--- a/notify-time
+++ b/old/notify-time
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