From cd5fd9bde283454bb64549bb064ecd3d50500d23 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Mon, 1 Jul 2019 18:14:16 -0400 Subject: Make use of PREFIX environment variable This patch puts the environment variable PREFIX in more use. If specified, mull-wizard Makefile substitute all instances of prefix with the provided environment variable. Signed-off-by: Ayman Bagabas --- bin/mw | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 651dd90..3268fa5 100755 --- a/bin/mw +++ b/bin/mw @@ -8,11 +8,7 @@ command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" } ! command -v mbsync >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit -case "$(uname)" in - Linux) prefix="/usr" ;; - *) prefix="/usr/local" ;; -esac - +prefix="/usr/local" muttdir="$HOME/.config/mutt" # Main mutt config location accdir="$muttdir/accounts" # Directory for account settings maildir="$HOME/.local/share/mail" # Location of mail storage -- cgit v1.2.3 From ff57bd2eb785ea393fd569751c47b93339af7861 Mon Sep 17 00:00:00 2001 From: Wayne Reeves Date: Fri, 8 Nov 2019 19:01:41 -0600 Subject: Fix Malformed UTF-8 Character in Mailsync fixes #322 (#323) * line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line * change the pgrep line * Revert "Update domains.csv (#321)" This reverts commit a92c01e13121f42b9f9b8962ae2c07b0a0ce5d4d. * Revert "Revert "Update domains.csv (#321)"" This reverts commit af0c0826b9a699780256dc8492e74a157cab2a85. * Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line" This reverts commit ca64a6ae56a31ead28cc638d8d8dac7e28f9df68. * Revert "Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line"" This reverts commit 4304eb731c109289251e06ef86377d372cef07e4. --- bin/mailsync | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index d79507d..c56ccb2 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -2,12 +2,13 @@ # Sync mail and give notification if there is new mail. export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus +export DBUS_SESSION_BUS_ADDRESS export DISPLAY=:0.0 [ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store" # Run only if user logged in (prevent cron errors) -pgrep -u "$USER" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} +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 -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;} -- cgit v1.2.3 From b3ab7aacf8357cd6247084fe5e869b46ba9bac6c Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 12 Nov 2019 06:18:51 -0500 Subject: pseudomailboxes fix --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index a89d5ef..5e03606 100755 --- a/bin/mw +++ b/bin/mw @@ -242,7 +242,7 @@ finalize() { \ trash=$(echo "$boxes" | grep -i -m 1 trash | sed 's/=/+/g') sed -ibu "/^mailboxes\|^set record\|^set postponed\|^set trash\|^set spoolfile/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" { echo "set spoolfile = \"$spoolfile\""; echo "set record = \"$record\""; echo "set postponed = \"$postponed\""; echo "set trash = \"$trash\""; } >> "$accdir/$idnum-$title.muttrc" - echo "mailboxes =$title ===================== $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc" + echo "mailboxes $(echo "$boxes" | sed -e "s/^\|$/\"/g" | tr "\n" " ")" >> "$accdir/$idnum-$title.muttrc" printf "Setting up your keyboard shortcuts for jumping between mailboxes...\\n" sed -ibu "/# mw-autogenerated/d" "$accdir/$idnum-$title.muttrc" ; rm -f "$accdir/$idnum-$title.muttrcbu" echo "$boxes" | grep -i inbox | head -n 1 | formatShortcut i inbox -- cgit v1.2.3 From 6aa28a56b1d9b027a48feb26dc4c45bc829e5d65 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 23 Nov 2019 19:23:27 -0500 Subject: STATUSBAR matching LARBS changes --- bin/mailsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index c56ccb2..212a97c 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -48,7 +48,7 @@ else fi echo " 🔃" > /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 i3blocks >/dev/null 2>&1 +pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 # Parallelize multiple accounts for account in $accounts @@ -58,7 +58,7 @@ done wait rm -f /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 i3blocks >/dev/null 2>&1 +pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 notmuch new 2>/dev/null -- cgit v1.2.3 From 3fee819bfe39449687fa1ad038e9df914c7247da Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:42:08 -0500 Subject: fix if STATUSBAR not set --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index 212a97c..f0b62ea 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -48,7 +48,7 @@ else fi echo " 🔃" > /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 +pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 # Parallelize multiple accounts for account in $accounts -- cgit v1.2.3 From 7698abb0f9fc236b578e3ec6caa31867de019c6e Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:44:23 -0500 Subject: lol fix other --- bin/mailsync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index f0b62ea..f7c3211 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -58,7 +58,7 @@ done wait rm -f /tmp/imapsyncicon_"$USER" -pkill -RTMIN+12 "$STATUSBAR" >/dev/null 2>&1 +pkill -RTMIN+12 "${STATUSBAR:?}" >/dev/null 2>&1 notmuch new 2>/dev/null -- cgit v1.2.3 From 938af8f7ebe8b769f0916ebdb19b146d0463409a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:48:33 -0500 Subject: env bash --- bin/muttimage | 4 ++-- bin/mw | 2 +- bin/openfile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/muttimage b/bin/muttimage index c798293..a846bea 100755 --- a/bin/muttimage +++ b/bin/muttimage @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash #get image resolution resolution=$(identify $1 | awk '{print $3}') IFS='x' # x is set as delimiter -read -ra ADDR <<< "$resolution" +read -ra ADDR <<< "$resolution" width=${ADDR[0]} height=${ADDR[1]} diff --git a/bin/mw b/bin/mw index 5e03606..99c640e 100755 --- a/bin/mw +++ b/bin/mw @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" [ -z ${PASSWORD_STORE_DIR+x} ] && PASSWORD_STORE_DIR="$HOME/.password-store" [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && diff --git a/bin/openfile b/bin/openfile index e530b3e..b16483b 100755 --- a/bin/openfile +++ b/bin/openfile @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # Helps open a file with xdg-open from mutt in a external program without weird side effects. [ $(uname) = "Darwin" ] && opener="open" || opener="setsid xdg-open" mkdir -p "/tmp/$USER-mutt-tmp" -- cgit v1.2.3 From 02b8e2a58c603b841c747b71a7a2b6c1e70c7912 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 24 Nov 2019 07:48:43 -0500 Subject: don't expire unread explicit --- bin/mw | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/mw b/bin/mw index 99c640e..ea00271 100755 --- a/bin/mw +++ b/bin/mw @@ -73,6 +73,7 @@ Patterns * !\"[Gmail]/All Mail\" Create Both SyncState * MaxMessages $maxmes +ExpireUnread no # End profile " -- cgit v1.2.3 From dfdc3162bafa4abebcb91106085aaf4f575db57d Mon Sep 17 00:00:00 2001 From: Ole Martin Ruud Date: Wed, 27 Nov 2019 14:16:37 +0100 Subject: Add app name to notify-send invocation (#324) This enables users to easily recognize notifications to be able to modify or style them through notification daemons. --- bin/mailsync | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mailsync b/bin/mailsync index f7c3211..2cec271 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -20,7 +20,7 @@ command -v notify-send >/dev/null || echo "Note that \`libnotify\` or \`libnotif if [ "$(uname)" = "Darwin" ]; then notify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $account\"" && sleep 2 ;} else - notify() { notify-send "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} + notify() { notify-send --app-name="mutt-wizard" "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} fi # Check account for new mail. Notify if there is new content. @@ -35,7 +35,7 @@ syncandnotify() { # Extract subject and sender from mail. from=$(awk '/^From: / && ++n ==1,/^\<.*\>:/' "$file" | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | awk '{ $1=""; if (NF>=3)$NF=""; print $0 }' | sed 's/^[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//') subject=$(awk '/^Subject: / && ++n == 1,/^\<.*\>: / && ++i == 2' "$file" | head -n-1 | perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' | sed 's/^Subject: //' | sed 's/^{[[:blank:]]*[\"'\''\<]*//;s/[\"'\''\>]*[[:blank:]]*$//' | tr -d '\n') - notify-send "📧$from:" "$subject" & + notify-send --app-name="mutt-wizard" "📧$from:" "$subject" & done fi } -- cgit v1.2.3