This commit is contained in:
parent
03a404699d
commit
4d6e7aff25
1 changed files with 34 additions and 0 deletions
|
|
@ -15,6 +15,12 @@ in
|
|||
enable = my.mkDisableOption "zsh configuration";
|
||||
|
||||
launchTmux = mkEnableOption "auto launch tmux at shell start";
|
||||
|
||||
notify = {
|
||||
enable = mkEnableOption "zsh-done notification";
|
||||
|
||||
enableSsh = mkEnableOption "notify through SSH connections";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
|
|
@ -93,5 +99,33 @@ in
|
|||
enableVteIntegration = true;
|
||||
};
|
||||
}
|
||||
|
||||
(lib.mkIf cfg.notify.enable {
|
||||
home.zsh = {
|
||||
plugins = [
|
||||
{
|
||||
name = "zsh-done";
|
||||
file = "share/zsh/site-functions/done.plugin.zsh";
|
||||
src = pkgs.my.zsh-done;
|
||||
}
|
||||
];
|
||||
|
||||
localVariables = {
|
||||
# Enable `zsh-done` through SSH, if configured
|
||||
DONE_ALLOW_NONGRAPHICAL = lib.mkIf cfg.notify.enableSsh 1;
|
||||
};
|
||||
|
||||
# Use OSC-777 to send the notification through SSH
|
||||
initExtra = lib.mkIf cfg.notify.enableSsh ''
|
||||
done_send_notification() {
|
||||
local exit_status="$1"
|
||||
local title="$2"
|
||||
local message="$3"
|
||||
|
||||
${lib.getExe pkgs.my.osc777} "$title" "$message"
|
||||
}
|
||||
'';
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue