aboutsummaryrefslogtreecommitdiff
path: root/status-openbsd
blob: 1f88b500129918ae6ba6487cea0057dce0674024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Prints some status info to stdout. Includes:
#	- date and time
#	- battery
#	- wifi (requires ifconfig on OpenBSD)

# Usage: status [separator]

sep=${1:-" | "}

time=$(date +"%H:%M")
date=$(date +"%d %B %Y")
battery="$(apm | grep -o '[^ ]*%')"
network="$(ifconfig athn0 | grep status | sed 's/.*status: //')"
if [ "$network" = "active" ]; then
	network="$(ifconfig athn0 | grep nwid | sed 's/.*nwid //;s/ chan.*//')"
fi

echo "$network$sep$battery$sep$date$sep$time"

Generated with cgit - Back to sebastiano.tronto.net