From c74365888889dacc403ec50a92180144a771bac4 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sun, 15 Oct 2017 17:29:31 +0200 Subject: Add i3blocks config --- i3/.config/i3blocks/bin/email | 10 ++++++ i3/.config/i3blocks/bin/wifi | 7 ++++ i3/.config/i3blocks/config | 74 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100755 i3/.config/i3blocks/bin/email create mode 100755 i3/.config/i3blocks/bin/wifi create mode 100644 i3/.config/i3blocks/config (limited to 'i3/.config/i3blocks') diff --git a/i3/.config/i3blocks/bin/email b/i3/.config/i3blocks/bin/email new file mode 100755 index 0000000..ab875e0 --- /dev/null +++ b/i3/.config/i3blocks/bin/email @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +nMails=$(find $HOME/.mail -path '*/new/*' -type f -not -path '*/rss/*' -not -path '*/lists/*' | wc -l) +echo -e "${nMails}\n${nMails}" + +if [[ ${nMails} -eq 0 ]]; then + echo \#FFFFFF +else + echo \#00FF00 +fi diff --git a/i3/.config/i3blocks/bin/wifi b/i3/.config/i3blocks/bin/wifi new file mode 100755 index 0000000..2e47da2 --- /dev/null +++ b/i3/.config/i3blocks/bin/wifi @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +quality=$(lspci | grep -i Wireless | sed 's/^.*(rev \(.*\))/\1/') +ssid=$(iwconfig wlp2s0 | grep -oP '(?<=ESSID:").*(?=")') +address=$(ip addr show wlp2s0 | grep -oP -m1 "(?<=inet ).*(?=/)") + +echo "(${quality}% at ${ssid}) ${address}" diff --git a/i3/.config/i3blocks/config b/i3/.config/i3blocks/config new file mode 100644 index 0000000..af4d658 --- /dev/null +++ b/i3/.config/i3blocks/config @@ -0,0 +1,74 @@ +# i3blocks config file +# +# Please see man i3blocks for a complete reference! +# The man page is also hosted at http://vivien.github.io/i3blocks +# +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +# Each block command defaults to the script name to avoid boilerplate. +command=/usr/lib/i3blocks/$BLOCK_NAME +separator_block_width=15 +markup=none + + +# Volume indicator +# +# The first parameter sets the step (and units to display) +# The second parameter overrides the mixer selection +# See the script for details. +[volume] +label=♪ +instance=Master +interval=5 + +[email] +label=W: +command=~/dotfiles/i3/.config/i3blocks/bin/wifi +separator=true +interval=5 + +[wifi] +label=Mail: +command=~/dotfiles/i3/.config/i3blocks/bin/email +separator=true +interval=5 + +[disk] +label=HOME +interval=30 + +[cpu_usage] +label=CPU +interval=10 +min_width=CPU: 100.00% + +[battery] +label=BAT +interval=30 + +[time] +command=date '+%Y-%m-%d %H:%M' +interval=5 + +[mediaplayer] +instance=spotify +interval=5 +signal=10 -- cgit v1.2.3