feat(terminal): themed Kitty when OpenGL < 4.3 (#95)
All checks were successful
Check / eval (push) Successful in 3m41s
All checks were successful
Check / eval (push) Successful in 3m41s
Ghostty needs OpenGL 4.3; older GPUs (Intel HD 4000) top out at 4.2. Installer probes glxinfo and writes settings.terminal=kitty into theme-state when below the floor. modules/home/kitty.nix enables Kitty with the same palette, mono font, and opacity as Ghostty so the fallback still looks like Nomarchy. Default machines stay Ghostty-only (no kitty in the HM closure). Doctor and calendar still invoke Ghostty by class — V3 on Acer for SUPER+Return. Verified: V0 flake check; installer-safety; HM with terminal=kitty builds themed kitty.conf + TERMINAL=kitty; default template has no kitty bin.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
./ghostty.nix
|
||||
./kitty.nix # themed fallback when Ghostty cannot run (OpenGL < 4.3)
|
||||
./btop.nix
|
||||
./rofi.nix # launcher theming + the nomarchy-menu dispatcher
|
||||
./swaync.nix # notification daemon, themed from the same JSON
|
||||
|
||||
63
modules/home/kitty.nix
Normal file
63
modules/home/kitty.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
# Kitty — fallback terminal when Ghostty cannot run (OpenGL < 4.3 on
|
||||
# older GPUs, e.g. Intel HD 4000). Themed from the same theme-state.json
|
||||
# as Ghostty so a machine that needs the fallback still looks like
|
||||
# Nomarchy. Enabled when nomarchy.terminal is "kitty" (installer sets
|
||||
# that after a GL probe) or when nomarchy.kitty.enable is forced on.
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
t = config.nomarchy.theme;
|
||||
c = t.colors;
|
||||
# Default terminal may be a bare name ("kitty") or a path; match the
|
||||
# basename so settings.terminal = "kitty" and nomarchy.terminal =
|
||||
# "${pkgs.kitty}/bin/kitty" both light this module.
|
||||
terminalIsKitty =
|
||||
let
|
||||
term = config.nomarchy.terminal;
|
||||
base = lib.last (lib.splitString "/" term);
|
||||
in
|
||||
base == "kitty" || lib.hasPrefix "kitty " term;
|
||||
|
||||
enabled = config.nomarchy.kitty.enable || terminalIsKitty;
|
||||
|
||||
# Kitty colorN = ANSI 0–15 from the theme palette.
|
||||
colorSettings = lib.listToAttrs (
|
||||
lib.imap0 (i: color: {
|
||||
name = "color${toString i}";
|
||||
value = color;
|
||||
}) t.ansi
|
||||
);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf enabled {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
shellIntegration.enableBashIntegration = true;
|
||||
shellIntegration.enableZshIntegration = true;
|
||||
|
||||
font = {
|
||||
name = t.fonts.mono;
|
||||
size = t.fonts.size;
|
||||
};
|
||||
|
||||
settings = {
|
||||
background = c.base;
|
||||
foreground = c.text;
|
||||
cursor = c.accent;
|
||||
cursor_text_color = c.base;
|
||||
selection_background = c.overlay;
|
||||
selection_foreground = c.text;
|
||||
url_color = c.accent;
|
||||
active_border_color = c.accent;
|
||||
inactive_border_color = c.surface;
|
||||
# Match Ghostty's padding / opacity so the two terminals feel
|
||||
# like the same product when a machine falls back.
|
||||
background_opacity = t.ui.terminalOpacity;
|
||||
window_padding_width = lib.mkDefault 12;
|
||||
confirm_os_window_close = lib.mkDefault 0;
|
||||
enable_audio_bell = lib.mkDefault false;
|
||||
wayland_titlebar_color = lib.mkDefault "background";
|
||||
} // colorSettings;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -101,9 +101,17 @@ in
|
||||
terminal = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config.nomarchy.settings.terminal or "ghostty";
|
||||
description = "Terminal emulator command, used by keybinds and $TERMINAL.";
|
||||
example = "kitty";
|
||||
description = ''
|
||||
Terminal emulator command, used by keybinds and `$TERMINAL`.
|
||||
Default is Ghostty. On GPUs below OpenGL 4.3 the installer writes
|
||||
`settings.terminal = "kitty"` so SUPER+Return still works (Ghostty
|
||||
needs 4.3; see docs/REQUIREMENTS.md). Set explicitly to override.
|
||||
'';
|
||||
};
|
||||
|
||||
kitty.enable = lib.mkEnableOption "Kitty with Nomarchy theming (palette/font/opacity from theme-state); also auto-on when nomarchy.terminal is kitty (OpenGL < 4.3 install fallback)";
|
||||
|
||||
keyboard.layout = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config.nomarchy.settings.keyboard.layout or "us";
|
||||
|
||||
Reference in New Issue
Block a user