diff --git a/.dotter/global.toml b/.dotter/global.toml index 9efd8c6..06895f8 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -38,6 +38,8 @@ ssh = "~" "terminal/.config/vifm/vifmrc" = { target = "~/.config/vifm/vifmrc", type = "symbolic" } terminal = "~" +# LINUX: A linux machine, with systemd enabled, auto-mounting set up and a nice productivity suite. + [linux] depends = ["base", "disks", "pass", "office", "services", "social", "writing"] @@ -64,6 +66,8 @@ office = "~" "services/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" } "services/usv.sh" = { target = "~/.config/sh/alias.d/usv.sh", type = "symbolic" } "services/sv" = { target = "~/.config/service", type = "symbolic"} +# FIXME: Disabling existing systemd services for the moment +"services/systemd" = { target = "~/NOWHERE", type = "symbolic", if = "false" } services = "~" [social.files] diff --git a/office/.config/goimapnotify/goimapnotify.yaml b/office/.config/goimapnotify/goimapnotify.yaml deleted file mode 100644 index c014443..0000000 --- a/office/.config/goimapnotify/goimapnotify.yaml +++ /dev/null @@ -1,10 +0,0 @@ -configurations: - - host: imap.example.com - port: 993 - tls: true - tlsOptions: - starttls: false - boxes: - - mailbox: INBOX - onNewMail: neomutt-syncmail purelymail-inbox - onNewMailPost: 'notify-send "Incoming mail"' diff --git a/office/.local/bin/notmuch-contacts b/office/.local/bin/mail-searchcontacts similarity index 95% rename from office/.local/bin/notmuch-contacts rename to office/.local/bin/mail-searchcontacts index 0504b37..65c1f3c 100755 --- a/office/.local/bin/notmuch-contacts +++ b/office/.local/bin/mail-searchcontacts @@ -1,7 +1,7 @@ #!/usr/bin/env sh # gets known e-mail adresses out of the current notmuch database # -# called like `notmuch-contacts [myadress]` +# called like `mail-searchcontacts [myadress]` # # where myaddress can be anything that connects mails to their adresses: # if directly found in the 'from': field, it will return those adresses diff --git a/office/.local/bin/neomutt-syncmail b/office/.local/bin/neomutt-syncmail index 5303a60..d52ce92 100755 --- a/office/.local/bin/neomutt-syncmail +++ b/office/.local/bin/neomutt-syncmail @@ -39,35 +39,26 @@ # MBSYNC_PASSWORD_FILE="/path/to/gpg/file.gpg" # What to run before and after decrypting the password file. -if pass coffin -v 1>/dev/null 2>&1; then - PASSWORD_CMD="pass open -t 1min" -fi - +PASSWORD_CMD="pass open -t 1min" # POST_PASSWORD_CMD="" -PING_TARGET="9.9.9.9" - prehook() { - if [ "$MBSYNC_PRE" != "" ]; then + if [ -n "$MBSYNC_PRE" ]; then eval "$MBSYNC_PRE" return 0 fi checkwarnuser - if command -v imapfilter 1>/dev/null 2>&1; then - imapfilter -c "${XDG_CONFIG_HOME:-$HOME/.config}/imapfilter/config.lua" - fi + imapfilter -c "${XDG_CONFIG_HOME:-$HOME/.config}/imapfilter/config.lua" } posthook() { - if [ "$MBSYNC_POST" != "" ]; then + if [ -n "$MBSYNC_POST" ]; then eval "$MBSYNC_POST" return 0 fi - if command -v notmuch 1>/dev/null 2>&1; then - notmuch new 2>/dev/null - countnew - fi + notmuch new 2>/dev/null + countnew } # use notmuch to index incoming mail and set the @@ -79,7 +70,7 @@ countnew() { # fail the routine and optionally send a message why fail() { - [ "$1" != "" ] && echo "$1" + [ -n "$1" ] && echo "$1" exit 1 } @@ -89,7 +80,7 @@ checkmail() { checkonline() { # Ping 1.1.1.1 to confirm that we are on the internet - ping -c 1 "$PING_TARGET" >/dev/null 2>/dev/null || fail "checkmail cannot access the internet." + ping -c 1 "1.1.1.1" >/dev/null 2>/dev/null || fail "checkmail can not access the internet." } # warn user that he has to enter his password in a moment @@ -103,15 +94,15 @@ checkwarnuser() { } enablegpgagent() { - [ "$agt" != "" ] && return + [ -n "$agt" ] && return - if [ "$PASSWORD_CMD" != "" ]; then + if [ -n "$PASSWORD_CMD" ]; then IFS=" " read -r -a PASSWORD_CMD <<<"$PASSWORD_CMD" # shellcheck disable=SC2068 - agt=$("${PASSWORD_CMD[@]}") + agt=$(${PASSWORD_CMD[@]}) fi - if [ "$POST_PASSWORD_CMD" != "" ]; then + if [ -n "$POST_PASSWORD_CMD" ]; then IFS=" " read -r -a POST_PASSWORD_CMD <<<"$POST_PASSWORD_CMD" "${POST_PASSWORD_CMD[@]}" fi @@ -147,7 +138,7 @@ if [ "$1" = "raw" ]; then checkmail exit # any other argument passed through selects mbsync targets -elif [ "$1" != "" ]; then +elif [ -n "$1" ]; then selected_mailbox="$1" fi @@ -162,7 +153,7 @@ main() { fi tries=$((tries + 1)) - if [ "$tries" -gt "${MBSYNC_MAX_TRIES:-3}" ]; then + if [ $tries -gt "${MBSYNC_MAX_TRIES:-3}" ]; then fail "maximum retries reached without success." fi done