From 332103c2275664959846cee14619c30f7531b482 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sun, 18 Dec 2022 02:58:13 +1000 Subject: [PATCH] spice up cli life some more: - mx for fzf manix - orage maybe useful as a calendar?? - email notifications - all user services allowed to send notifications --- home/profiles/cli/default.nix | 4 +++ home/profiles/desktop/default.nix | 3 ++ home/profiles/email/default.nix | 44 ++++-------------------------- hosts/profiles/desktop/default.nix | 3 +- 4 files changed, 14 insertions(+), 40 deletions(-) diff --git a/home/profiles/cli/default.nix b/home/profiles/cli/default.nix index 0dee1b3e..d60c5c46 100644 --- a/home/profiles/cli/default.nix +++ b/home/profiles/cli/default.nix @@ -4,6 +4,7 @@ binutils coreutils dnsutils + dasht dosfstools #git bottom @@ -87,6 +88,9 @@ fi vim flake.nix } + mx() { + manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix + } autopair-init ''; sessionVariables = { diff --git a/home/profiles/desktop/default.nix b/home/profiles/desktop/default.nix index 6ba393b5..71725766 100644 --- a/home/profiles/desktop/default.nix +++ b/home/profiles/desktop/default.nix @@ -31,6 +31,9 @@ in inotify-tools ]; + # set up env + xsession.enable = true; + xresources.properties = { "*.foreground" = "#95E6CB"; "*.background" = "#1F2430"; diff --git a/home/profiles/email/default.nix b/home/profiles/email/default.nix index 35fc9d10..1dc48e22 100644 --- a/home/profiles/email/default.nix +++ b/home/profiles/email/default.nix @@ -1,35 +1,4 @@ -{ config, pkgs, lib, ... }: -with lib; -let - safeName = lib.replaceStrings [ "@" ":" "\\" "[" "]" ] [ "-" "-" "-" "" "" ]; - imapnotifyAccounts = - filter (a: a.imapnotify.enable) (attrValues config.accounts.email.accounts); - genAccountUnit = account: - let name = safeName account.name; - in - { - name = "imapnotify-${name}-mine"; - value = { - Unit = { Description = "imapnotify for ${name}"; }; - - Service = { - ExecStart = "${pkgs.goimapnotify}/bin/goimapnotify -conf /nix/store/6030i9xdga98l2zyqarrqv5mrjynwm3i-imapnotify-anish-config.json"; # TODO horrible hard coded config location - Restart = "always"; - RestartSec = 30; - Type = "simple"; - # this is why we're overriding this stupid thing - # We need dbus for notify-send on systemd - Environment = [ - "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" - "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config" - ]; - }; - - Install = { WantedBy = [ "default.target" ]; }; - }; - }; - -in +{ pkgs, ... }: { #age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age"; #age.secrets.fastmail.owner = "anish"; @@ -41,12 +10,9 @@ in services.mbsync = { enable = true; frequency = "*:0/30"; - #postExec = "${pkgs.notmuch}/bin/notmuch new"; + postExec = "${pkgs.notmuch}/bin/notmuch new"; }; - # call our stupid way of overriding the imapnotify service - systemd.user.services = listToAttrs (map genAccountUnit [{ name = "anish"; }]); - services.imapnotify.enable = true; programs.mbsync.enable = true; programs.msmtp.enable = true; @@ -304,10 +270,10 @@ in extraConfig.local.subFolders = "Verbatim"; }; imapnotify = { - enable = false; + enable = true; boxes = [ "Inbox" ]; - onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index"; - onNotifyPost = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'"; + onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch new"; + onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New Email 📩'"; }; msmtp.enable = true; msmtp.extraConfig = { diff --git a/hosts/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix index d186e4bd..8e27c10e 100644 --- a/hosts/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -66,6 +66,7 @@ in scrot ripcord + xfce.orage feh sxiv xkblayout-state @@ -86,7 +87,7 @@ in dunst libnotify (polybar.override { - pulseSupport = true; + pulseSupport = false; nlSupport = true; }) papirus-icon-theme