From c058aca6e71fdb299837808b0a205ebd8110c8fb Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez <anthony@nezia.dev> Date: Fri, 24 Jan 2025 00:11:51 +0100 Subject: [PATCH] treewide: switch to ghostty --- modules/hm/programs/hypr/land/binds.nix | 2 +- modules/hm/programs/hypr/land/default.nix | 2 +- .../programs/terminal/emulators/default.nix | 5 +- .../programs/terminal/emulators/ghostty.nix | 54 +++++++++++++++++++ 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 modules/hm/programs/terminal/emulators/ghostty.nix diff --git a/modules/hm/programs/hypr/land/binds.nix b/modules/hm/programs/hypr/land/binds.nix index 6ca7b94..ef286eb 100644 --- a/modules/hm/programs/hypr/land/binds.nix +++ b/modules/hm/programs/hypr/land/binds.nix @@ -17,7 +17,7 @@ in { "$mod, SUPER_L, exec, ${toggle "anyrun" true}" ]; bind = [ - "$mod, Return, exec, ${run "foot"}" + "$mod, Return, exec, ${run "ghostty"}" "$mod, n, exec, ${run "neovide"}" "$mod, w, exec, ${run "firefox"}" ", Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output" diff --git a/modules/hm/programs/hypr/land/default.nix b/modules/hm/programs/hypr/land/default.nix index 02d4a77..c18262a 100644 --- a/modules/hm/programs/hypr/land/default.nix +++ b/modules/hm/programs/hypr/land/default.nix @@ -72,7 +72,7 @@ in { "fullscreen, initialclass:^(steam_app_)(.*)$" # inhibit idle on every fullscreen app except games - "idleinhibit always, fullscreen:1,!initialclass:^(steam_app_)(.*)$" + "idleinhibit fullscreen,class:.*" ]; render = { diff --git a/modules/hm/programs/terminal/emulators/default.nix b/modules/hm/programs/terminal/emulators/default.nix index 4f0ca1e..f13829f 100644 --- a/modules/hm/programs/terminal/emulators/default.nix +++ b/modules/hm/programs/terminal/emulators/default.nix @@ -1,3 +1,6 @@ { - imports = [./foot.nix]; + imports = [ + ./foot.nix + ./ghostty.nix + ]; } diff --git a/modules/hm/programs/terminal/emulators/ghostty.nix b/modules/hm/programs/terminal/emulators/ghostty.nix new file mode 100644 index 0000000..7ed7b57 --- /dev/null +++ b/modules/hm/programs/terminal/emulators/ghostty.nix @@ -0,0 +1,54 @@ +{ + lib, + osConfig, + ... +}: let + inherit (lib) mapAttrs mkIf optionalAttrs removePrefix; + styleCfg = osConfig.local.style; + + mkGhosttyTheme = palette: let + colors = mapAttrs (_: value: removePrefix "#" value) palette; + in { + palette = [ + "0=#${colors.base00}" + "1=#${colors.base08}" + "2=#${colors.base0B}" + "3=#${colors.base0A}" + "4=#${colors.base0D}" + "5=#${colors.base0E}" + "6=#${colors.base0C}" + "7=#${colors.base05}" + "8=#${colors.base02}" + "9=#${colors.base08}" + "10=#${colors.base0B}" + "11=#${colors.base0A}" + "12=#${colors.base0D}" + "13=#${colors.base0E}" + "14=#${colors.base0C}" + "15=#${colors.base07}" + "16=#${colors.base09}" + "17=#${colors.base0F}" + "18=#${colors.base01}" + "19=#${colors.base02}" + "20=#${colors.base04}" + "21=#${colors.base06}" + ]; + background = colors.base00; + foreground = colors.base05; + cursor-color = colors.base06; + selection-background = colors.base02; + selection-foreground = colors.base05; + }; +in { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.ghostty = lib.mkMerge [ + { + enable = true; + } + (optionalAttrs styleCfg.enable { + settings.theme = "base16"; + themes.base16 = mkIf styleCfg.enable (mkGhosttyTheme styleCfg.scheme.palette); + }) + ]; + }; +}