aboutsummaryrefslogtreecommitdiff
path: root/status-openbsd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xstatus-openbsd20
1 files changed, 20 insertions, 0 deletions
diff --git a/status-openbsd b/status-openbsd
new file mode 100755
index 0000000..1f88b50
--- /dev/null
+++ b/status-openbsd
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3# Prints some status info to stdout. Includes:
4# - date and time
5# - battery
6# - wifi (requires ifconfig on OpenBSD)
7
8# Usage: status [separator]
9
10sep=${1:-" | "}
11
12time=$(date +"%H:%M")
13date=$(date +"%d %B %Y")
14battery="$(apm | grep -o '[^ ]*%')"
15network="$(ifconfig athn0 | grep status | sed 's/.*status: //')"
16if [ "$network" = "active" ]; then
17 network="$(ifconfig athn0 | grep nwid | sed 's/.*nwid //;s/ chan.*//')"
18fi
19
20echo "$network$sep$battery$sep$date$sep$time"

Generated with cgit - Back to sebastiano.tronto.net