From 03162970cd6dadfac58f169cd50aed5a5aeec14f Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Tue, 26 Mar 2019 18:26:47 +0200 Subject: [PATCH] gnome-terminal: add cursor and highlight color settings --- modules/programs/gnome-terminal.nix | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/modules/programs/gnome-terminal.nix b/modules/programs/gnome-terminal.nix index d520ef044..9a4436449 100644 --- a/modules/programs/gnome-terminal.nix +++ b/modules/programs/gnome-terminal.nix @@ -11,6 +11,22 @@ let . ${pkgs.gnome3.vte}/etc/profile.d/vte.sh ''; + backForeSubModule = types.submodule ( + { ... }: { + options = { + foreground = mkOption { + type = types.str; + description = "The foreground color."; + }; + + background = mkOption { + type = types.str; + description = "The background color."; + }; + }; + } + ); + profileColorsSubModule = types.submodule ( { ... }: { options = { @@ -34,6 +50,18 @@ let type = types.listOf types.str; description = "The terminal palette."; }; + + cursor = mkOption { + default = null; + type = types.nullOr backForeSubModule; + description = "The color for the terminal cursor."; + }; + + highlight = mkOption { + default = null; + type = types.nullOr backForeSubModule; + description = "The colors for the terminal’s highlighted area."; + }; }; } ); @@ -70,6 +98,15 @@ let description = "The font name, null to use system default."; }; + allowBold = mkOption { + default = null; + type = types.nullOr types.bool; + description = '' + If true, allow applications in the + terminal to make text boldface. + ''; + }; + scrollOnOutput = mkOption { default = true; type = types.bool; @@ -115,6 +152,9 @@ let background-color = pcfg.colors.backgroundColor; palette = pcfg.colors.palette; } + // optionalAttrs (pcfg.allowBold != null) { + allow-bold = pcfg.allowBold; + } // ( if (pcfg.colors.boldColor == null) then { bold-color-same-as-fg = true; } @@ -123,6 +163,24 @@ let bold-color = pcfg.colors.boldColor; } ) + // ( + if (pcfg.colors.cursor != null) + then { + cursor-colors-set = true; + cursor-foreground-color = pcfg.colors.cursor.foreground; + cursor-background-color = pcfg.colors.cursor.background; + } + else { cursor-colors-set = false; } + ) + // ( + if (pcfg.colors.highlight != null) + then { + highlight-colors-set = true; + highlight-foreground-color = pcfg.colors.highlight.foreground; + highlight-background-color = pcfg.colors.highlight.background; + } + else { highlight-colors-set = false; } + ) ) );