From fbc555bdc78f47eca44b32f4597d61b1f531cd6a Mon Sep 17 00:00:00 2001 From: samedami Date: Sat, 16 May 2020 18:45:33 +0200 Subject: [PATCH] Add 'syncnow' script and binding Also remove symlink to 'mailsync' script. --- .config/sxhkd/sxhkdrc | 2 ++ .local/bin/cron/mailsync | 2 +- .local/bin/scripts/dwmbar/mails | 3 ++- .local/bin/scripts/mailsync | 1 - .local/bin/scripts/syncnow | 6 ++++++ 5 files changed, 11 insertions(+), 3 deletions(-) delete mode 120000 .local/bin/scripts/mailsync create mode 100755 .local/bin/scripts/syncnow diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 8e6de61..01028cf 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -47,6 +47,8 @@ F11 [ $(pgrep ffmpeg) ] && blaze -s || blaze End lockscreen; systemctl suspend +Pause + syncnow #~~~~~~~ diff --git a/.local/bin/cron/mailsync b/.local/bin/cron/mailsync index ef2156d..a23f75d 100755 --- a/.local/bin/cron/mailsync +++ b/.local/bin/cron/mailsync @@ -50,7 +50,7 @@ else accounts=$* fi -echo " " > /tmp/imapsyncicon_"$USER" +echo "" > /tmp/imapsyncicon_"$USER" refbar & # Parallelize multiple accounts diff --git a/.local/bin/scripts/dwmbar/mails b/.local/bin/scripts/dwmbar/mails index a253a20..f69f4b5 100755 --- a/.local/bin/scripts/dwmbar/mails +++ b/.local/bin/scripts/dwmbar/mails @@ -6,4 +6,5 @@ unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx icon="$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)" -[ "$unread" -gt "0" ] && echo " $unread$icon" || echo "" +[ "$unread" -gt "0" ] && echo " $unread " || echo "" +echo "$icon" diff --git a/.local/bin/scripts/mailsync b/.local/bin/scripts/mailsync deleted file mode 120000 index eeea574..0000000 --- a/.local/bin/scripts/mailsync +++ /dev/null @@ -1 +0,0 @@ -../cron/mailsync \ No newline at end of file diff --git a/.local/bin/scripts/syncnow b/.local/bin/scripts/syncnow new file mode 100755 index 0000000..e6527ca --- /dev/null +++ b/.local/bin/scripts/syncnow @@ -0,0 +1,6 @@ +#!/bin/sh + +# Sync mails and news now! + +~/.local/bin/cron/mailsync & +~/.local/bin/cron/newsup &