From e6afa0199ee60f870ce78c60fbb573e74f82ff0d Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Mon, 15 Mar 2021 08:28:27 +0100 Subject: [PATCH] update mutt and joplin --- configs/sternchen/configuration.nix | 2 +- configs/workhorse/mail-fetcher.nix | 2 +- library/default.nix | 6 ++-- system/desktop/mail-stuff.nix | 55 +++++++++++++++++++++++------ system/desktop/packages.nix | 14 ++++++++ 5 files changed, 63 insertions(+), 16 deletions(-) diff --git a/configs/sternchen/configuration.nix b/configs/sternchen/configuration.nix index e11cc42..61fa741 100644 --- a/configs/sternchen/configuration.nix +++ b/configs/sternchen/configuration.nix @@ -49,7 +49,7 @@ hardware.opengl = { enable = true; extraPackages = [ pkgs.vaapiIntel ]; - driSupoort = true; + driSupport = true; driSupport32Bit = true; }; nixpkgs.config.packageOverrides = pkgs: { diff --git a/configs/workhorse/mail-fetcher.nix b/configs/workhorse/mail-fetcher.nix index 28d1f01..f9f5416 100644 --- a/configs/workhorse/mail-fetcher.nix +++ b/configs/workhorse/mail-fetcher.nix @@ -185,7 +185,7 @@ let } { query = "from:data-treuhand.de"; - tags = [ "+mindcurv" "+work" "-inbox" "-unread" ]; + tags = [ "+mindcurv" "+work" "-inbox" "-unread" "-junk" ]; } { query = "from:immocation.de"; diff --git a/library/default.nix b/library/default.nix index 3a3813f..50e971d 100644 --- a/library/default.nix +++ b/library/default.nix @@ -1,14 +1,14 @@ { pkgs, lib, ... }: { desktopFile = bin: - { longName ? "Script", command ? "${bin}/bin/${bin.name}", ... }: + { comment ? "No Comment", longName ? "Script", command ? "${bin}/bin/${bin.name}", ... }: pkgs.writeTextFile { name = "${bin.name}.desktop"; destination = "/share/applications/${bin.name}.desktop"; text = '' [Desktop Entry] Type=Application - Exec=${bin}/bin/${command} %U - Comment=An open source web browser from Google + Exec=${command} %U + Comment=${comment} Terminal=false Name=${bin.name} GenericName=${longName} diff --git a/system/desktop/mail-stuff.nix b/system/desktop/mail-stuff.nix index b3dca26..3a7f511 100644 --- a/system/desktop/mail-stuff.nix +++ b/system/desktop/mail-stuff.nix @@ -226,7 +226,7 @@ in { set index_format="${index_format} %r |" - virtual-mailboxes "INBOX" "notmuch://?query=(tag:inbox or (tag:sent and not tag:archive)) AND NOT tag:discourse AND NOT tag:muted AND NOT tag:list AND NOT tag:spam AND NOT tag:fraud" + virtual-mailboxes "INBOX" "notmuch://?query=(tag:inbox or (tag:sent and not tag:archive)) AND NOT tag:discourse AND NOT tag:muted AND NOT tag:list AND NOT tag:fraud AND NOT tag:junk" virtual-mailboxes "Unread" "notmuch://?query=(tag:unread AND NOT tag:muted)" virtual-mailboxes "Space left" "notmuch://?query=((tag:spaceleft OR tag:space-lef) AND NOT tag:muted)" virtual-mailboxes "Sononym" "notmuch://?query=(tag:sononym AND NOT tag:muted)" @@ -245,13 +245,12 @@ in { virtual-mailboxes "Archive" "notmuch://?query=tag:archive" virtual-mailboxes "Sent" "notmuch://?query=tag:sent" virtual-mailboxes "Fraud" "notmuch://?query=(tag:fraud)" - virtual-mailboxes "Junk" "notmuch://?query=(tag:junk OR tag:spam OR tag:fraud)" + virtual-mailboxes "Junk" "notmuch://?query=(tag:junk)" virtual-mailboxes "All" "notmuch://?query=*" tag-transforms "junk" "k" \ "unread" "u" \ "replied" "↻" \ - "TODO" "T" # notmuch bindings bind index \\\\ noop @@ -273,18 +272,23 @@ in { # keys bindings # ------------- - #killed bind index d noop + bind index D noop bind pager d noop + bind pager D noop + macro index D "-inbox -unread +deleted\n" # tag as deleted mail + macro index d "-deleted\n" # tag as deleted mail + macro pager D "-inbox -unread +deleted\n" # tag as deleted mail + macro pager d "-deleted\n" # tag as deleted mail bind index S noop bind index s noop bind pager S noop bind pager s noop - macro index S "-inbox -unread +junk\n" # tag as Junk mail - macro index s "-junk\n" # tag as Junk mail - macro pager S "-inbox -unread +junk\n" # tag as Junk mail - macro pager s "-junk\n" # tag as Junk mail + macro index S "-inbox -unread +junk\n" # tag as junk mail + macro index s "-junk\n" # tag as junk mail + macro pager S "-inbox -unread +junk\n" # tag as junk mail + macro pager s "-junk\n" # tag as junk mail bind index r noop bind index R noop @@ -301,9 +305,9 @@ in { bind pager A noop bind pager a noop macro index A "+archive -unread -inbox\n" # tag as Archived - macro index a "-archive\n" # tag as Archived + macro index a "-archive\n" # tag as Archived macro pager A "+archive -unread -inbox\n" # tag as Archived - macro pager a "-archive\n" # tag as Archived + macro pager a "-archive\n" # tag as Archived bind index U noop bind index u noop @@ -328,7 +332,7 @@ in { bind pager T noop macro index T "${ pkgs.writers.writeDash "mutt2task" '' - ${pkgs.taskwarrior}/bin/task add +email E-mail: $( ${pkgs.gnugrep}/bin/grep 'Subject' $* | awk -F: '{print $2}' ) + ${pkgs.taskwarrior}/bin/task add +email scheduled:today E-mail: $( ${pkgs.gnugrep}/bin/grep 'Subject' $* | awk -F: '{print $2}' ) '' }" @@ -376,6 +380,34 @@ in { ${mailSend}/bin/mail-send ${mailSync}/bin/mail-sync ''; + mailDelete = let + notmuch = "${pkgs.notmuch}/bin/notmuch" + ; + in + pkgs.writers.writeBashBin "mail-delete" '' + set -efu + set -o pipefail + + if ! ${notmuch} search --exclude=false tag:deleted | tac ; then + echo 'No killed mail.' + exit 1 + fi + + printf 'want do rm this mail? \[y/N\] ' + read REPLY + + case "$REPLY" in + y|Y) :;; # continue + *) + echo 'abort.' + exit 2 + ;; + esac + + ${notmuch} search --output=files --exclude=false tag:deleted | while read line; do rm -v "$line" ; done + ${notmuch} new + ''; + in [ pkgs.notmuch pkgs.muchsync @@ -385,6 +417,7 @@ in { mailSend pkgs.neomutt mutt + mailDelete ]; } diff --git a/system/desktop/packages.nix b/system/desktop/packages.nix index 7ecf862..e97487b 100644 --- a/system/desktop/packages.nix +++ b/system/desktop/packages.nix @@ -15,6 +15,17 @@ let in pkgs.writers.writeBashBin "all-licenses" (lib.concatStringsSep "\n" licenses); + #joplin = pkgs.joplin-desktop; + #joplin = pkgs.joplin-desktop; + joplin = pkgs.writers.writeBashBin "joplin" '' + if [[ ! -x "$HOME/programs/Joplin.AppImage" ]] + then + echo "$HOME/programs/Joplin.AppImage does not exist or is not executable"; + exit 1 + fi + exec ${pkgs.appimage-run}/bin/appimage-run "$HOME/programs/Joplin.AppImage" + ''; + zettlr = pkgs.writers.writeBashBin "zettlr" '' if [[ ! -x "$HOME/programs/Zettlr.AppImage" ]] then @@ -153,6 +164,9 @@ in { in [ zettlr + (library.desktopFile zettlr { longName = "Zettlr"; }) + joplin + (library.desktopFile joplin { longName = "Joplin"; }) zim weight