From 9c336785acd73ea5a5613045602f6d8fefe1d3e4 Mon Sep 17 00:00:00 2001 From: encrypt Date: Mon, 14 Mar 2016 17:20:21 +0100 Subject: [PATCH] add bar --- bar/README.md | 16 ++++++++++++++++ bar/bar.sh | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 bar/README.md create mode 100755 bar/bar.sh diff --git a/bar/README.md b/bar/README.md new file mode 100644 index 0000000..b921a03 --- /dev/null +++ b/bar/README.md @@ -0,0 +1,16 @@ +bar.sh +====== + +Minimalistic statusbar for [dwm](http://dwm.suckless.org/) + +Requires symbola for fancy utf-8 icons. + +Information +----------- + + * Date + * Volume percentage + * Battery percentage + * Charger connection + * Connman status + * vpn status diff --git a/bar/bar.sh b/bar/bar.sh new file mode 100755 index 0000000..bd53cbc --- /dev/null +++ b/bar/bar.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +while : +do + date=$(date "+%d %b %Y %H:%M") + battery=$(acpi -b | cut -f 2 -d "," | tr -d [:space:]) + adapter=$(acpi -a | cut -f 3 -d " " | cut -f 1 -d "-") + connection=$(connmanctl state | head -n 1 | cut -d ' ' -f 5) + volume=$(amixer sget Master | tail -n 1 | cut -d '[' -f 2 | tr -d '] ') + vcn=$(ip addr show dev vcn 2>&1 | grep LOWER_UP | sed 's/.*LOWER_UP.*/\\U002B50/') + status=$(echo -e "\U001F553 $date \U1F50A $volume \U1F5F2 $battery \U0001F50C $adapter \U0001F30F $connection $vcn") + xsetroot -name "$status" + sleep 1 +done