From 3cfff1dd717a6848a56f3154de236e28c98a95c4 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Wed, 17 Jul 2024 11:30:04 -0300 Subject: [PATCH] hm: move from wezterm to alacritty --- home-manager.nix | 2 +- programs/alacritty.nix | 38 +++++++++++++++++++++++++ programs/hyprland/default.nix | 2 +- programs/rofi/default.nix | 2 +- programs/wezterm/default.nix | 53 ----------------------------------- 5 files changed, 41 insertions(+), 56 deletions(-) create mode 100644 programs/alacritty.nix delete mode 100644 programs/wezterm/default.nix diff --git a/home-manager.nix b/home-manager.nix index 8c36341..20f111a 100644 --- a/home-manager.nix +++ b/home-manager.nix @@ -7,6 +7,7 @@ # Import configurations for better modularity. imports = [ + ./programs/alacritty.nix ./programs/emacs ./programs/fish ./programs/git.nix @@ -18,7 +19,6 @@ ./programs/spotify ./programs/tmux ./programs/waybar.nix - ./programs/wezterm ]; # Home Manager needs a bit of information about you and the paths it should diff --git a/programs/alacritty.nix b/programs/alacritty.nix new file mode 100644 index 0000000..323d4b9 --- /dev/null +++ b/programs/alacritty.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: + +let + catppuccin-theme = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "alacritty"; + rev = "94800165c13998b600a9da9d29c330de9f28618e"; + hash = "sha256-Pi1Hicv3wPALGgqurdTzXEzJNx7vVh+8B9tlqhRpR2Y="; + }; +in +{ + programs.alacritty = { + enable = true; + settings = { + import = [ "${catppuccin-theme}/catppuccin-frappe.toml" ]; + + font = { + normal = { + family = "FantasqueSansM Nerd Font"; + style = "Regular"; + }; + + size = 13; + }; + + window = { + decorations = "None"; + opacity = 0.88; + blur = true; + + padding = { + x = 18; + y = 18; + }; + }; + }; + }; +} diff --git a/programs/hyprland/default.nix b/programs/hyprland/default.nix index 6172d20..b41683b 100644 --- a/programs/hyprland/default.nix +++ b/programs/hyprland/default.nix @@ -203,7 +203,7 @@ bind = $mainMod, M, exit bind = $mainMod, O, togglesplit # dwindle bind = $mainMod, P, pseudo # dwindle - bind = $mainMod, Q, exec, wezterm + bind = $mainMod, Q, exec, alacritty bind = $mainMod, R, exec, rofi -show drun bind = $mainMod, V, togglefloating diff --git a/programs/rofi/default.nix b/programs/rofi/default.nix index ce54140..1ad328b 100644 --- a/programs/rofi/default.nix +++ b/programs/rofi/default.nix @@ -20,7 +20,7 @@ modi = "run,drun,window"; show-icons = true; sidebar-mode = true; - terminal = "wezterm"; + terminal = "alacritty"; }; theme = ./catppuccin-frappe.rasi; diff --git a/programs/wezterm/default.nix b/programs/wezterm/default.nix deleted file mode 100644 index 4322480..0000000 --- a/programs/wezterm/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ ... }: - -{ - programs.wezterm = { - enable = true; - extraConfig = # lua - '' - local wezterm = require("wezterm") - - -- Needed for folke's ZenMode in neovim - wezterm.on('user-var-changed', function(window, pane, name, value) - local overrides = window:get_config_overrides() or {} - if name == "ZEN_MODE" then - local incremental = value:find("+") - local number_value = tonumber(value) - if incremental ~= nil then - while (number_value > 0) do - window:perform_action(wezterm.action.IncreaseFontSize, pane) - number_value = number_value - 1 - end - overrides.enable_tab_bar = false - elseif number_value < 0 then - window:perform_action(wezterm.action.ResetFontSize, pane) - overrides.font_size = nil - overrides.enable_tab_bar = true - else - overrides.font_size = number_value - overrides.enable_tab_bar = false - end - end - window:set_config_overrides(overrides) - end) - - return { - color_scheme = "Catppuccin Frappe", - -- Unfortunately broken on Hyprland, AGAIN - -- see https://github.com/wez/wezterm/issues/5604 - enable_wayland = false, - font = wezterm.font("FantasqueSansM Nerd Font"), - font_size = 13, - hide_tab_bar_if_only_one_tab = true, - hide_mouse_cursor_when_typing = false, - window_background_opacity = 0.88, - window_padding = { - left = 18, - right = 18, - top = 18, - bottom = 18, - }, - } - ''; - }; -}