Add mail module for polybar (uses notmuch)
authorAmin Bandali <amin@aminb.org>
Thu, 27 Apr 2017 21:36:37 +0000 (17:36 -0400)
committerAmin Bandali <amin@aminb.org>
Thu, 27 Apr 2017 21:36:37 +0000 (17:36 -0400)
also depends: pacaur -S ttf-font-awesome

bspwm/.config/bspwm/bspwmrc
polybar/.config/polybar/config
polybar/.local/bin/launch-polybar [deleted file]
polybar/.local/bin/polybar-launch [new file with mode: 0755]

index de905a7..e90c6f4 100755 (executable)
@@ -2,7 +2,7 @@
 
 sxhkd &
 sh ~/.fehbg &
 
 sxhkd &
 sh ~/.fehbg &
-launch-polybar
+polybar-launch
 connman-gtk &
 pnmixer &
 compton &
 connman-gtk &
 pnmixer &
 compton &
index 15799aa..2e5855f 100644 (file)
@@ -45,10 +45,11 @@ module-margin-right = 2
 font-0 = Ubuntu:fontformat=truetype:antialias=true:pixelsize=9;1
 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
 font-2 = Wuncon Siji:pixelsize=10;1
 font-0 = Ubuntu:fontformat=truetype:antialias=true:pixelsize=9;1
 font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
 font-2 = Wuncon Siji:pixelsize=10;1
+font-3 = FontAwesome:pixelsize=10;1
 
 modules-left = bspwm
 modules-center = xwindow
 
 modules-left = bspwm
 modules-center = xwindow
-modules-right = volume filesystem xkeyboard memory cpu battery temperature date powermenu
+modules-right = volume filesystem mail xkeyboard memory cpu battery temperature date powermenu
 
 tray-position = right
 ;tray-padding = 2
 
 tray-position = right
 ;tray-padding = 2
@@ -353,6 +354,15 @@ menu-2-0-exec = sudo poweroff
 menu-2-1 = cancel
 menu-2-1-exec = menu-open-0
 
 menu-2-1 = cancel
 menu-2-1-exec = menu-open-0
 
+[module/mail]
+type = custom/script
+interval = 300
+format = <label>
+format-prefix = " "
+format-prefix-foreground = ${colors.foreground-alt}
+format-underline = #0a6cf5
+exec = notmuch count tag:unread
+
 [settings]
 screenchange-reload = true
 ;compositing-background = xor
 [settings]
 screenchange-reload = true
 ;compositing-background = xor
diff --git a/polybar/.local/bin/launch-polybar b/polybar/.local/bin/launch-polybar
deleted file mode 100755 (executable)
index 4fcd323..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env sh
-
-# Terminate already running bar instances
-killall -q polybar
-
-# Wait until the processes have been shut down
-while pgrep -x polybar >/dev/null; do sleep 1; done
-
-# Launch main bar
-polybar main &
-
-echo "Bars launched..."
diff --git a/polybar/.local/bin/polybar-launch b/polybar/.local/bin/polybar-launch
new file mode 100755 (executable)
index 0000000..4fcd323
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+# Terminate already running bar instances
+killall -q polybar
+
+# Wait until the processes have been shut down
+while pgrep -x polybar >/dev/null; do sleep 1; done
+
+# Launch main bar
+polybar main &
+
+echo "Bars launched..."