update a bunch of stuff
prithugoswami prithugoswami524@gmail.com
Tue, 25 Dec 2018 01:27:08 +0530
4 files changed,
49 insertions(+),
12 deletions(-)
M
i3blocks/battery.sh
→
i3blocks/battery.sh
@@ -1,5 +1,5 @@
-percent=$(acpi | awk '{print $4}') -state=$(acpi | awk '{print $3}' | tr -d ',') +percent=$(acpi | cut -d ' ' -f4 | tr -d ',') +state=$(acpi | cut -d ' ' -f3 | tr -d ',') case $state in Charging)
M
i3blocks/config
→
i3blocks/config
@@ -1,11 +1,12 @@
-[disk] -command=~/.config/i3blocks/disk -interval=30 +[taskwarrior] +command=~/.config/i3blocks/taskwarrior +interval=1 markup=pango -[cpu_load] -command=~/.config/i3blocks/cpu_load.sh -interval=5 +#[disk] +#command=~/.config/i3blocks/disk +#interval=30 +#markup=pango #[bandwidth] #command=~/.config/i3blocks/bandwidth2@@ -15,7 +16,12 @@
[newsboat] markup=pango command=~/.config/i3blocks/newsboat.sh -interval=900 +interval=once +signal=10 + +[cpu_load] +command=~/.config/i3blocks/cpu_load.sh +interval=5 [battery] markup=pango@@ -25,4 +31,4 @@
[time] markup=pango interval=1 -command=date +"%a, %d %b %Y ╱ <b>%I:%M %P</b>" +command=date +"%a, %d %b %Y<span foreground='#666666'> ╱ </span><b>%I:%M %P</b>"
M
i3blocks/newsboat.sh
→
i3blocks/newsboat.sh
@@ -1,10 +1,19 @@
#!/bin/sh -count=$(newsboat -x "reload" && newsboat -x "print-unread" | awk '{print $1}') icon=$(echo -en "<span font='Font Awesome 5 Free'>\uf09e</span>") +count=$(cat $HOME/.newsboat/unread) + +case $BLOCK_BUTTON in + 1) setsid st -e newsboat && + count=$(newsboat -x 'print-unread' | cut -d ' ' -f1) ;; +esac if [ $count -gt 0 ]; then echo "<span color='#00FF00'>$icon $count</span>" +elif [ $count = $(echo -e '\uf2f1') ] +then + count=$(echo -en "<span font='Font Awesome 5 Free 8'>\uf2f1</span>") + echo "<span color='#666666'>$icon $count</span>" else - echo "$icon $count" + echo -e "<span color='#666666'>$icon $count</span>" fi
A
i3blocks/taskwarrior
@@ -0,0 +1,22 @@
+#!/bin/sh +incount=$(task +PENDING +in count) +todocount=$(task +PENDING -in count) +inbox_icon=$(echo -en "<b><span font='Font Awesome 5 Free'>\uf01c</span></b>") +todo_icon=$(echo -en "<b><span font='Font Awesome 5 Free'>\uf071</span></b>") + +if [ $incount -gt 0 ] +then + inbox_out=$(echo -en "$inbox_icon <b>$incount</b>") +fi + +if [ $todocount -gt 0 ] +then + todo_out=$(echo -en "<span color='#d8c61e'>$todo_icon <b>$todocount</b></span>") +fi + +[ "$todo_out" ] && [ "$inbox_out" ] && separator=$(echo "<span color='#666666'> ╱ </span>") + +if [ "$todo_out" ] || [ "$inbox_out" ] +then + echo -e "$todo_out$separator$inbox_out" +fi