From 300dd3dc0d54f0a6d79d3d88e9766b8f22356c1a Mon Sep 17 00:00:00 2001 From: Yifei Zhan Date: Sun, 25 Jul 2021 01:38:21 +0000 Subject: [PATCH] Revert "add support for OpenBSD" This reverts commit 5b2e12a7cfdc551600c8add5c53890a87089d787. --- bin/mailsync | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/bin/mailsync b/bin/mailsync index 09a562a..f00baf1 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -11,16 +11,10 @@ # issues. It also should at least be compatible with Linux (and maybe BSD) with # Xorg and MacOS as well. -if [ "$(uname)" == 'OpenBSD' ]; then - alias grep=ggrep - alias sed=gsed - alias awk=gawk -fi - # Run only if user logged in (prevent cron errors) pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} # Run only if not already running in other instance -pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;} +pidof mbsync >/dev/null && { echo "mbsync is already running."; exit ;} # First, we have to get the right variables for the mbsync file, the pass # archive, notmuch and the GPG home. This is done by searching common profile @@ -41,17 +35,6 @@ case "$(uname)" in notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} messageinfo() { osascript -e "display notification with title \"📧 $from\" subtitle \"$subject\"" ;} ;; - OpenBSD) - displays="$(pgrep -lf X11R6 | grep -wo "[0-9]*:[0-9]\+" | sort -u)" - notify() { [ -n "$displays" ] && for x in ${displays:-0:}; do - export DISPLAY=$x - notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." - done ;} - messageinfo() { [ -n "$displays" ] && for x in ${displays:-0:}; do - export DISPLAY=$x - notify-send --app-name="mutt-wizard" "📧$from:" "$subject" - done ;} - ;; *) case "$(readlink -f /sbin/init)" in *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;