Compare commits

..

2 commits

Author SHA1 Message Date
c044b636e9 homes: bazin: enable zsh notifications
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-02-13 11:32:44 +00:00
d6c2948135 home: zsh: add 'zsh-done' 2024-02-13 11:32:44 +00:00
2 changed files with 13 additions and 3 deletions

View file

@ -25,6 +25,12 @@
zsh = {
notify = {
enable = true;
ssh = {
enable = true;
useOsc777 = false; # notify-send is proxied to the ChromeOS layer
};
};
};
};

View file

@ -19,7 +19,11 @@ in
notify = {
enable = mkEnableOption "zsh-done notification";
enableSsh = mkEnableOption "notify through SSH connections";
ssh = {
enable = mkEnableOption "notify through SSH/non-graphical connections";
useOsc777 = lib.my.mkDisableOption "use OSC-777 for notifications";
};
};
};
@ -114,11 +118,11 @@ in
# don't use `mkIf`
localVariables = { }
# Enable `zsh-done` through SSH, if configured
// lib.optionalAttrs cfg.notify.enableSsh { DONE_ALLOW_NONGRAPHICAL = 1; }
// lib.optionalAttrs cfg.notify.ssh.enable { DONE_ALLOW_NONGRAPHICAL = 1; }
;
# Use OSC-777 to send the notification through SSH
initExtra = lib.mkIf cfg.notify.enableSsh ''
initExtra = lib.mkIf cfg.notify.ssh.useOsc777 ''
done_send_notification() {
local exit_status="$1"
local title="$2"