Added scripts

This commit is contained in:
jacob.eva 2023-03-08 13:43:33 +00:00
parent e7214b60fa
commit d915aaf7ed
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
3 changed files with 14 additions and 0 deletions

View File

@ -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:

10
blocks-battery Normal file
View File

@ -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

2
blocks-mail Normal file
View File

@ -0,0 +1,2 @@
unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/INBOX/new/ -type f | wc -l 2>/dev/null)"
echo $unread