diff --git a/Makefile b/Makefile index f0c027b..e157553 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ clean: install: output mkdir -p $(DESTDIR)$(PREFIX)/bin install -m 0755 someblocks $(DESTDIR)$(PREFIX)/bin/someblocks + install -m 0755 blocks-battery $(DESTDIR)$(PREFIX)/bin/blocks-battery + install -m 0755 blocks-mail $(DESTDIR)$(PREFIX)/bin/blocks-mail mkdir -p $(DESTDIR)$(MANPREFIX)/man1 install -m 0644 someblocks.1 $(DESTDIR)$(MANPREFIX)/man1/someblocks.1 uninstall: diff --git a/blocks-battery b/blocks-battery new file mode 100644 index 0000000..a8cfe06 --- /dev/null +++ b/blocks-battery @@ -0,0 +1,10 @@ +#!/bin/bash +percentage=$(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep percentage: | cut -c 26-) +state=$(upower -i /org/freedesktop/UPower/devices/battery_BAT1 | grep state: | cut -c 26- | grep -E '^discharging$') + +if [ -z $state ] +then + echo $percentage+ +else + echo $percentage +fi diff --git a/blocks-mail b/blocks-mail new file mode 100644 index 0000000..5730681 --- /dev/null +++ b/blocks-mail @@ -0,0 +1,2 @@ +unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/INBOX/new/ -type f | wc -l 2>/dev/null)" +echo $unread