From d2da342f62bc37ee31deda90748e1453329b8357 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 7 Oct 2017 18:02:37 +0200 Subject: [PATCH] polybar: redo icons + add app watcher modules --- os/+arch/.config/polybar/config | 27 ++++++++++++------- .../modules/{redshift => app-redshift} | 0 os/+arch/.config/polybar/modules/app-rslsync | 9 +++++++ os/+arch/.config/polybar/modules/mail | 7 +++-- os/+arch/.config/polybar/modules/updates | 5 ++-- 5 files changed, 34 insertions(+), 14 deletions(-) rename os/+arch/.config/polybar/modules/{redshift => app-redshift} (100%) create mode 100755 os/+arch/.config/polybar/modules/app-rslsync diff --git a/os/+arch/.config/polybar/config b/os/+arch/.config/polybar/config index cb905509..109ed7ee 100644 --- a/os/+arch/.config/polybar/config +++ b/os/+arch/.config/polybar/config @@ -49,7 +49,7 @@ font-2 = "FontAwesome:fontformat=truetype:size=11;1" modules-left = bspwm modules-center = date -modules-right = pkg mail wlan eth volume redshift +modules-right = pkg mail wlan eth volume app-redshift app-rslsync enable-ipc = true @@ -230,18 +230,18 @@ format-connected = format-disconnected-underline = ${colors.alert} label-connected = -label-disconnected = ! +label-disconnected = ! label-disconnected-foreground = ${xrdb:color1} -ramp-signal-0 =  +ramp-signal-0 =  ramp-signal-0-foreground = #22e5e8e6 -ramp-signal-1 =  +ramp-signal-1 =  ramp-signal-1-foreground = ${xrdb:color3} -ramp-signal-2 =  +ramp-signal-2 =  ramp-signal-2-foreground = ${xrdb:color11} -ramp-signal-3 =  +ramp-signal-3 =  ramp-signal-3-foreground = #ffe5e8e6 -ramp-signal-4 =  +ramp-signal-4 =  ramp-signal-4-foreground = ${xrdb:color2} [module/eth] @@ -405,11 +405,18 @@ hook-0 = ~/.config/polybar/modules/mail initial = 1 click-left = polybar-msg -p %pid% hook mail 1 -[module/redshift] +[module/app-redshift] type = custom/script -interval = 30 +interval = 120 label-padding = 1 -exec = ~/.config/polybar/modules/redshift +exec = ~/.config/polybar/modules/app-redshift exec-if = "pgrep redshift >/dev/null" +[module/app-rslsync] +type = custom/script +interval = 60 +label-padding = 1 +exec = ~/.config/polybar/modules/app-rslsync +exec-if = "pgrep rslsync >/dev/null" + ; vim:ft=dosini diff --git a/os/+arch/.config/polybar/modules/redshift b/os/+arch/.config/polybar/modules/app-redshift similarity index 100% rename from os/+arch/.config/polybar/modules/redshift rename to os/+arch/.config/polybar/modules/app-redshift diff --git a/os/+arch/.config/polybar/modules/app-rslsync b/os/+arch/.config/polybar/modules/app-rslsync new file mode 100755 index 00000000..043f678c --- /dev/null +++ b/os/+arch/.config/polybar/modules/app-rslsync @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +icon="" + +if pgrep -x rslsync &> /dev/null; then + echo "%{F#e5e8e6}$icon" +else + echo "%{F#65737E}$icon" +fi diff --git a/os/+arch/.config/polybar/modules/mail b/os/+arch/.config/polybar/modules/mail index 231495aa..550a4300 100755 --- a/os/+arch/.config/polybar/modules/mail +++ b/os/+arch/.config/polybar/modules/mail @@ -11,7 +11,7 @@ CONFIG_FILE = os.path.expanduser("~/.private/config/email") CACHE_FILE = "/tmp/polybar-mail" COLOR_HL = "3E86B8" -COLOR_NONE = "5C6370" +COLOR_NONE = "22e5e8e6" COLOR_ERR = "CC626A" # @@ -80,7 +80,10 @@ def main(): ding() color = COLOR_HL if total > 0 else COLOR_NONE - print("%{{u#{}}}%{{F#{}}}{} {}".format(color, color, ICON, total)) + if total == 0: + print("%{{u#{}}}%{{F#{}}}{} ".format(color, color, ICON)) + else: + print("%{{u#{}}}%{{F#{}}}{} {}".format(color, color, ICON, total)) cache.write_text(str(total)) else: diff --git a/os/+arch/.config/polybar/modules/updates b/os/+arch/.config/polybar/modules/updates index 573ee3cc..988100a9 100755 --- a/os/+arch/.config/polybar/modules/updates +++ b/os/+arch/.config/polybar/modules/updates @@ -4,13 +4,14 @@ aur=$(cower -u | wc -l) last=$(/tmp/polybar-updates fi else - echo "%{F#22e5e8e6}%{F-} " + echo "%{F#22e5e8e6}${icon}%{F-} " fi