mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
kitty: add quick-access-terminal configuration
This commit is contained in:
parent
26993d87fd
commit
d587e11cef
5 changed files with 65 additions and 1 deletions
10
modules/misc/news/2025/09/2025-09-08_22-33-53.nix
Normal file
10
modules/misc/news/2025/09/2025-09-08_22-33-53.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
time = "2025-09-09T05:33:53+00:00";
|
||||||
|
condition = config.programs.kitty.enable;
|
||||||
|
message = ''
|
||||||
|
Kitty 0.42 adds a quick access terminal that appears and disappears with a key press.
|
||||||
|
|
||||||
|
You can now configure this with 'programs.kitty.quickAccessTerminalConfig'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -255,7 +255,25 @@ in
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
description = "Additional configuration to add.";
|
description = "Additional configuration to add to kitty.conf.";
|
||||||
|
};
|
||||||
|
|
||||||
|
quickAccessTerminalConfig = mkOption {
|
||||||
|
type = types.attrsOf settingsValueType;
|
||||||
|
default = { };
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
start_as_hidden = false;
|
||||||
|
hide_on_focus_loss = false;
|
||||||
|
background_opacity = 0.85;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
{file}`$XDG_CONFIG_HOME/kitty/quick-access-terminal.conf`. See
|
||||||
|
<https://sw.kovidgoyal.net/kitty/kittens/quick-access-terminal/>
|
||||||
|
for the documentation.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -319,6 +337,14 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile."kitty/quick-access-terminal.conf" = mkIf (cfg.quickAccessTerminalConfig != { }) {
|
||||||
|
text = ''
|
||||||
|
# Generated by Home Manager.
|
||||||
|
# See https://sw.kovidgoyal.net/kitty/kittens/quick-access-terminal/
|
||||||
|
${toKittyConfig cfg.quickAccessTerminalConfig}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
home.activation.checkKittyTheme = mkIf (cfg.themeFile != null) (
|
home.activation.checkKittyTheme = mkIf (cfg.themeFile != null) (
|
||||||
let
|
let
|
||||||
themePath = "${pkgs.kitty-themes}/share/kitty-themes/themes/${cfg.themeFile}.conf";
|
themePath = "${pkgs.kitty-themes}/share/kitty-themes/themes/${cfg.themeFile}.conf";
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@
|
||||||
kitty-theme-to-themeFile = ./theme-to-themeFile.nix;
|
kitty-theme-to-themeFile = ./theme-to-themeFile.nix;
|
||||||
kitty-null-shellIntegration = ./null-shellIntegration.nix;
|
kitty-null-shellIntegration = ./null-shellIntegration.nix;
|
||||||
kitty-example-mkOrder = ./example-mkOrder.nix;
|
kitty-example-mkOrder = ./example-mkOrder.nix;
|
||||||
|
kitty-example-quickAccessTerminalConfig = ./example-quickAccessTerminalConfig.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Generated by Home Manager.
|
||||||
|
# See https://sw.kovidgoyal.net/kitty/kittens/quick-access-terminal/
|
||||||
|
background_opacity 0.850000
|
||||||
|
hide_on_focus_loss no
|
||||||
|
start_as_hidden no
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.kitty = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
quickAccessTerminalConfig = {
|
||||||
|
start_as_hidden = false;
|
||||||
|
hide_on_focus_loss = false;
|
||||||
|
background_opacity = 0.85;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/kitty/quick-access-terminal.conf
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.config/kitty/quick-access-terminal.conf \
|
||||||
|
${./example-quickAccessTerminalConfig-expected.conf}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue